You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2012/09/28 06:01:04 UTC
svn commit: r1391291 - in /thrift/site: content/docs/ content/tutorial/
layouts/ publish/docs/idl/ publish/tutorial/as3/ publish/tutorial/c_glib/
publish/tutorial/cocoa/ publish/tutorial/cpp/ publish/tutorial/csharp/
publish/tutorial/d/ publish/tutoria...
Author: jfarrell
Date: Fri Sep 28 04:01:02 2012
New Revision: 1391291
URL: http://svn.apache.org/viewvc?rev=1391291&view=rev
Log:
Updating tutorials with new templated layout and adding THRIFT-1688.
THRIFT-1688: Update IDL page
Patch: Russell Winstead
Modified:
thrift/site/content/docs/idl.md
thrift/site/content/tutorial/as3.md
thrift/site/content/tutorial/c_glib.md
thrift/site/content/tutorial/cocoa.md
thrift/site/content/tutorial/cpp.md
thrift/site/content/tutorial/csharp.md
thrift/site/content/tutorial/d.md
thrift/site/content/tutorial/delphi.md
thrift/site/content/tutorial/erl.md
thrift/site/content/tutorial/go.md
thrift/site/content/tutorial/hs.md
thrift/site/content/tutorial/java.md
thrift/site/content/tutorial/javame.md
thrift/site/content/tutorial/js.md
thrift/site/content/tutorial/nodejs.md
thrift/site/content/tutorial/ocaml.md
thrift/site/content/tutorial/perl.md
thrift/site/content/tutorial/php.md
thrift/site/content/tutorial/py.md
thrift/site/content/tutorial/rb.md
thrift/site/content/tutorial/st.md
thrift/site/layouts/tutorial_intro.md
thrift/site/publish/docs/idl/index.html
thrift/site/publish/tutorial/as3/index.html
thrift/site/publish/tutorial/c_glib/index.html
thrift/site/publish/tutorial/cocoa/index.html
thrift/site/publish/tutorial/cpp/index.html
thrift/site/publish/tutorial/csharp/index.html
thrift/site/publish/tutorial/d/index.html
thrift/site/publish/tutorial/delphi/index.html
thrift/site/publish/tutorial/erl/index.html
thrift/site/publish/tutorial/go/index.html
thrift/site/publish/tutorial/hs/index.html
thrift/site/publish/tutorial/java/index.html
thrift/site/publish/tutorial/javame/index.html
thrift/site/publish/tutorial/nodejs/index.html
thrift/site/publish/tutorial/ocaml/index.html
thrift/site/publish/tutorial/perl/index.html
thrift/site/publish/tutorial/php/index.html
thrift/site/publish/tutorial/py/index.html
thrift/site/publish/tutorial/rb/index.html
thrift/site/publish/tutorial/st/index.html
Modified: thrift/site/content/docs/idl.md
URL: http://svn.apache.org/viewvc/thrift/site/content/docs/idl.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/docs/idl.md (original)
+++ thrift/site/content/docs/idl.md Fri Sep 28 04:01:02 2012
@@ -5,203 +5,214 @@ kind: doc
## Thrift interface description language
The Thrift interface definition language (IDL) allows for the definition of [Thrift Types](/docs/types/). A Thrift IDL file is processed by the Thrift code generator to produce code for the various target languages to support the defined structs and services in the IDL file.
-= Description =
+## Description
-''Under construction''
+*Under construction*
Here is a description of the Thrift IDL.
-
## Document
Every Thrift document contains 0 or more headers followed by 0 or more definitions.
-{{{[1] Document ::= Header* Definition*}}}
+ [1] Document ::= Header* Definition*
## Header
A header is either a Thrift include, a C++ include, or a namespace declaration.
-{{{[2] Header ::= Include | CppInclude | Namespace}}}
+ [2] Header ::= Include | CppInclude | Namespace
-## Thrift Include
+### Thrift Include
An include makes all the symbols from another file visible (with a prefix) and adds corresponding include statements into the code generated for this Thrift document.
-{{{[3] Include ::= 'include' Literal}}}
+ [3] Include ::= 'include' Literal
### C++ Include
A C++ include adds a custom C++ include to the output of the C++ code generator for this Thrift document.
-
-{{{[4] CppInclude ::= 'cpp_include' Literal}}}
+
+ [4] CppInclude ::= 'cpp_include' Literal
### Namespace
A namespace declares which namespaces/package/module/etc. the type definitions in this file will be declared in for the target languages. The namespace scope indicates which language the namespace applies to; a scope of '*' indicates that the namespace applies to all target languages.
-{{{[5] Namespace ::= ( 'namespace' ( NamespaceScope Identifier ) |}}}<<BR>>
-{{{ ( 'smalltalk.category' STIdentifier ) |}}}<<BR>>
-{{{ ( 'smalltalk.prefix' Identifier ) ) |}}}<<BR>>
-{{{ ( 'php_namespace' Literal ) |}}}<<BR>>
-{{{ ( 'xsd_namespace' Literal )}}}
+ [5] Namespace ::= ( 'namespace' ( NamespaceScope Identifier ) |
+ ( 'smalltalk.category' STIdentifier ) |
+ ( 'smalltalk.prefix' Identifier ) ) |
+ ( 'php_namespace' Literal ) |
+ ( 'xsd_namespace' Literal )
-{{{[6] NamespaceScope ::= '*' | 'cpp' | 'java' | 'py' | 'perl' | 'rb' | 'cocoa' | 'csharp'}}}
+ [6] NamespaceScope ::= '*' | 'cpp' | 'java' | 'py' | 'perl' | 'rb' | 'cocoa' | 'csharp'
-NB: Smalltalk has two distinct types of namespace commands.
-''Can someone who knows Smalltalk explain why Smalltalk needs two different kinds of namespaces?''
+N.B.: Smalltalk has two distinct types of namespace commands.
+*Can someone who knows Smalltalk explain why Smalltalk needs two different kinds of namespaces?*
-NB: The php_namespace directive will be deprecated at some point in the future in favor of the scoped syntax, but the scoped syntax is not yet supported for PHP.
+N.B.: The `php_namespace` directive will be deprecated at some point in the future in favor of the scoped syntax, but the scoped syntax is not yet supported for PHP.
-NB: The xsd_namespace directive has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged
+N.B.: The `xsd_namespace` directive has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged
## Definition
-{{{[7] Definition ::= Const | Typedef | Enum | Senum | Struct | Exception | Service}}}
+ [7] Definition ::= Const | Typedef | Enum | Senum | Struct | Exception | Service
### Const
-{{{[8] Const ::= 'const' FieldType Identifier '=' ConstValue ListSeparator?}}}
+ [8] Const ::= 'const' FieldType Identifier '=' ConstValue ListSeparator?
### Typedef
A typedef creates an alternate name for a type.
-{{{[9] Typedef ::= 'typedef' DefinitionType Identifier}}}
+ [9] Typedef ::= 'typedef' DefinitionType Identifier
### Enum
An enum creates an enumerated type, with named values. If no constant value is supplied, the value is either 0 for the first element, or one greater than the preceding value for any subsequent element. Any constant value that is supplied must be non-negative.
-{{{[10] Enum ::= 'enum' Identifier '{' (Identifier ('=' IntConstant)? ListSeparator?)* '}'}}}
+ [10] Enum ::= 'enum' Identifier '{' (Identifier ('=' IntConstant)? ListSeparator?)* '}'
### Senum
-{{{[11] Senum ::= 'senum' Identifier '{' (Literal ListSeparator?)* '}'}}}
+ [11] Senum ::= 'senum' Identifier '{' (Literal ListSeparator?)* '}'
### Struct
Structs are the fundamental compositional type in Thrift. The name of each field must be unique within the struct.
-{{{[12] Struct ::= 'struct' Identifier 'xsd_all'? '{' Field* '}'}}}
+ [12] Struct ::= 'struct' Identifier 'xsd_all'? '{' Field* '}'
-NB: The xsd_all keyword has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged
+N.B.: The `xsd_all` keyword has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged
### Exception
Exceptions are similar to structs except that they are intended to integrate with the native exception handling mechanisms in the target languages. The name of each field must be unique within the exception.
-{{{[13] Exception ::= 'exception' Identifier '{' Field* '}' }}}
+ [13] Exception ::= 'exception' Identifier '{' Field* '}'
### Service
A service provides the interface for a set of functionality provided by a Thrift server. The interface is simply a list of functions. A service can extend another service, which simply means that it provides the functions of the extended service in addition to its own.
-{{{[14] Service ::= 'service' Identifier ( 'extends' Identifier )? '{' Function* '}'}}}
+ [14] Service ::= 'service' Identifier ( 'extends' Identifier )? '{' Function* '}'
## Field
-{{{[15] Field ::= FieldID? FieldReq? FieldType Identifier ('= ConstValue)? XsdFieldOptions ListSeparator?}}}
+ [15] Field ::= FieldID? FieldReq? FieldType Identifier ('= ConstValue)? XsdFieldOptions ListSeparator?
### Field ID
-{{{[16] FieldID ::= IntConstant ':'}}}
+ [16] FieldID ::= IntConstant ':'
### Field Requiredness
-{{{[17] FieldReq ::= 'required' | 'optional'}}}
-
+ [17] FieldReq ::= 'required' | 'optional'
### XSD Options
-NB: These have some internal purpose at Facebook but serve no current purpose in Thrift. Use of these options is strongly discouraged.
+N.B.: These have some internal purpose at Facebook but serve no current purpose in Thrift. Use of these options is strongly discouraged.
-{{{[18] XsdFieldOptions ::= 'xsd_optional'? 'xsd_nillable'? XsdAttrs?}}}
+ [18] XsdFieldOptions ::= 'xsd_optional'? 'xsd_nillable'? XsdAttrs?
-{{{[19] XsdAttrs ::= 'xsd_attrs' '{' Field* '}'}}}
+ [19] XsdAttrs ::= 'xsd_attrs' '{' Field* '}'
## Functions
-{{{[20] Function ::= 'oneway'? FunctionType Identifier '(' Field* ')' Throws? ListSeparator?}}}
+ [20] Function ::= 'oneway'? FunctionType Identifier '(' Field* ')' Throws? ListSeparator?
-{{{[21] FunctionType ::= FieldType | 'void'}}}
+ [21] FunctionType ::= FieldType | 'void'
-{{{[22] Throws ::= 'throws' '(' Field* ')'}}}
+ [22] Throws ::= 'throws' '(' Field* ')'
## Types
-{{{[23] FieldType ::= Identifier | BaseType | ContainerType}}}
+ [23] FieldType ::= Identifier | BaseType | ContainerType
-{{{[24] DefinitionType ::= BaseType | ContainerType}}}
+ [24] DefinitionType ::= BaseType | ContainerType
-{{{[25] BaseType ::= 'bool' | 'byte' | 'i16' | 'i32' | 'i64' | 'double' |}}}<<BR>>
-{{{ 'string' | 'binary' | 'slist'}}}
+ [25] BaseType ::= 'bool' | 'byte' | 'i16' | 'i32' | 'i64' | 'double' | 'string' | 'binary' | 'slist'
-{{{[26] ContainerType ::= MapType | SetType | ListType}}}
+ [26] ContainerType ::= MapType | SetType | ListType
-{{{[27] MapType ::= 'map' CppType? '<' FieldType ',' FieldType '>'}}}
+ [27] MapType ::= 'map' CppType? '<' FieldType ',' FieldType '>'
-{{{[28] SetType ::= 'set' CppType? '<' FieldType '>'}}}
+ [28] SetType ::= 'set' CppType? '<' FieldType '>'
-{{{[29] ListType ::= 'list' '<' FieldType '>' CppType?}}}
+ [29] ListType ::= 'list' '<' FieldType '>' CppType?
-{{{[30] CppType ::= 'cpp_type' Literal}}}
+ [30] CppType ::= 'cpp_type' Literal
## Constant Values
-{{{[31] ConstValue ::= IntConstant | DoubleConstant | Literal | Identifier | ConstList | ConstMap}}}
+ [31] ConstValue ::= IntConstant | DoubleConstant | Literal | Identifier | ConstList | ConstMap
-{{{[32] IntConstant ::= ('+' | '-')? Digit+}}}
+ [32] IntConstant ::= ('+' | '-')? Digit+
-{{{[33] DoubleConstant ::= ('+' | '-')? Digit* ('.' Digit+)? ( ('E' | 'e') IntConstant )?}}}
+ [33] DoubleConstant ::= ('+' | '-')? Digit* ('.' Digit+)? ( ('E' | 'e') IntConstant )?
-{{{[34] ConstList ::= '[' (ConstValue ListSeparator?)* ']'}}}
+ [34] ConstList ::= '[' (ConstValue ListSeparator?)* ']'
-{{{[35] ConstMap ::= '{' (ConstValue ':' ConstValue ListSeparator?)* '}'}}}
+ [35] ConstMap ::= '{' (ConstValue ':' ConstValue ListSeparator?)* '}'
## Basic Definitions
### Literal
-{{{[36] Literal ::= ('"' [^"]* '"') | ("'" [^']* "'")}}}
+ [36] Literal ::= ('"' [^"]* '"') | ("'" [^']* "'")
### Identifier
-{{{[37] Identifier ::= ( Letter | '_' ) ( Letter | Digit | '.' | '_' )*}}}
+ [37] Identifier ::= ( Letter | '_' ) ( Letter | Digit | '.' | '_' )*
-{{{[38] STIdentifier ::= ( Letter | '_' ) ( Letter | Digit | '.' | '_' | '-' )*}}}
+ [38] STIdentifier ::= ( Letter | '_' ) ( Letter | Digit | '.' | '_' | '-' )*
### List Separator
-{{{[39] ListSeparator ::= ',' | ';'}}}
+ [39] ListSeparator ::= ',' | ';'
### Letters and Digits
-{{{[40] Letter ::= ['A'-'Z'] | ['a'-'z']}}}
+ [40] Letter ::= ['A'-'Z'] | ['a'-'z']
-{{{[41] Digit ::= ['0'-'9']}}}
+ [41] Digit ::= ['0'-'9']
-# Examples
+## Examples
Here are some examples of Thrift definitions, using the Thrift IDL:
- * [[http://svn.apache.org/repos/asf/thrift/trunk/test/ThriftTest.thrift | ThriftTest.thrift]] used by the Thrift TestFramework
- * Thrift [[http://svn.apache.org/repos/asf/thrift/trunk/tutorial/ | tutorial ]]
- * Facebook's [[http://svn.apache.org/repos/asf/thrift/trunk/contrib/fb303/if/fb303.thrift | fb303.thrift]]
- * [[http://cassandra.apache.org/ | Apache Cassandra's]] Thrift IDL: [[http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?view=co | cassandra.thrift]]
- * [[http://www.evernote.com/about/developer/api/ | Evernote API]]
-# To Do/Questions
+ * [ThriftTest.thrift][] used by the Thrift TestFramework
+ * Thrift [tutorial][]
+ * Facebook's [fb303.thrift][]
+ * [Apache Cassandra's][] Thrift IDL: [cassandra.thrift][]
+ * [Evernote API][]
+
+ [ThriftTest.thrift]: http://svn.apache.org/repos/asf/thrift/trunk/test/ThriftTest.thrift
+ [tutorial]: http://svn.apache.org/repos/asf/thrift/trunk/tutorial/
+ [fb303.thrift]: http://svn.apache.org/repos/asf/thrift/trunk/contrib/fb303/if/fb303.thrift
+ [Apache Cassandra's]: http://cassandra.apache.org/
+ [cassandra.thrift]: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?view=co
+ [Evernote API]: http://www.evernote.com/about/developer/api/
+
+## To Do/Questions
+
Initialization of Base Types for all Languages?
+
* Do all Languages initialize them to 0, bool=false and string=""? or null, undefined?
-Why does position of {{{CppType}}} vary between {{{SetType}}} and {{{ListType}}}?
- * std::set does sort the elements automatically, that's the design. see [Thrift Types](/docs/types/) or http://www.cplusplus.com/reference/stl/set/ for further details
+Why does position of `CppType` vary between `SetType` and `ListType`?
+
+ * std::set does sort the elements automatically, that's the design. see [Thrift Types](/docs/types/) or the [C++ std:set reference][] for further details
* The question is, how other languages are doing that? What about custom objects, do they have a Compare function the set the order correctly?
-Why can't {{{DefinitionType}}} be the same as {{{FieldType}}} (ie: include {{{Identifier}}})?
+ [C++ std:set reference]: http://www.cplusplus.com/reference/stl/set/
+
+Why can't `DefinitionType` be the same as `FieldType` (i.e. include `Identifier`)?
+
+Examine the `smalltalk.prefix` and `smalltalk.category` status (esp `smalltalk.category`, which takes `STIdentifier` as its argument)...
-Examine the {{{smalltalk.prefix}}} and {{{smalltalk.category}}} status (esp {{{smalltalk.category}}}, which takes {{{STIdentifier}}} as its argument)...
+What to do about `ListSeparator`? Do we really want to be as lax as we currently are?
-What to do about {{{ListSeparator}}}? Do we really want to be as lax as we currently are?
+Should `Field*` really be `Field+` in `Struct`, `Enum`, etc.?
-Should {{{Field*}}} really be {{{Field+}}} in {{{Struct}}}, {{{Enum}}}, etc.?
Modified: thrift/site/content/tutorial/as3.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/as3.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/as3.md (original)
+++ thrift/site/content/tutorial/as3.md Fri Sep 28 04:01:02 2012
@@ -1,3 +1,18 @@
---
title: "As3"
+library_lang: "as3"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-java">
+</code></pre>
+
+### Server
+
+
+## Additional Information
+
Modified: thrift/site/content/tutorial/c_glib.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/c_glib.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/c_glib.md (original)
+++ thrift/site/content/tutorial/c_glib.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "C Glib"
+library_lang: "c_glib"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-java">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/cocoa.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/cocoa.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/cocoa.md (original)
+++ thrift/site/content/tutorial/cocoa.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Objective-c"
+library_lang: "cocoa"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-c">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/cpp.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/cpp.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/cpp.md (original)
+++ thrift/site/content/tutorial/cpp.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,167 @@
---
title: "C++"
+library_lang: "cpp"
---
+<%= render 'tutorial_intro' %>
+### Prerequisites
+
+### Client
+
+<pre><code class="language-cpp">
+ shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
+ shared_ptr<TTransport> transport(new TBufferedTransport(socket));
+ shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
+ CalculatorClient client(protocol);
+
+ try {
+ transport->open();
+
+ client.ping();
+ printf("ping()\n");
+
+ int32_t sum = client.add(1,1);
+ printf("1+1=%d\n", sum);
+
+ Work work;
+ work.op = Operation::DIVIDE;
+ work.num1 = 1;
+ work.num2 = 0;
+
+ try {
+ int32_t quotient = client.calculate(1, work);
+ printf("Whoa? We can divide by zero!\n");
+ } catch (InvalidOperation &io) {
+ printf("InvalidOperation: %s\n", io.why.c_str());
+ }
+
+ work.op = Operation::SUBTRACT;
+ work.num1 = 15;
+ work.num2 = 10;
+ int32_t diff = client.calculate(1, work);
+ printf("15-10=%d\n", diff);
+
+ // Note that C++ uses return by reference for complex types to avoid
+ // costly copy construction
+ SharedStruct ss;
+ client.getStruct(ss, 1);
+ printf("Check log: %s\n", ss.value.c_str());
+
+ transport->close();
+ } catch (TException &tx) {
+ printf("ERROR: %s\n", tx.what());
+ }
+</code></pre>
+
+### Server
+<pre><code class="language-cpp">
+ shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
+ shared_ptr<CalculatorHandler> handler(new CalculatorHandler());
+ shared_ptr<TProcessor> processor(new CalculatorProcessor(handler));
+ shared_ptr<TServerTransport> serverTransport(new TServerSocket(9090));
+ shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
+
+ TSimpleServer server(processor,
+ serverTransport,
+ transportFactory,
+ protocolFactory);
+
+ printf("Starting the server...\n");
+ server.serve();
+</code></pre>
+
+
+### Server Handler
+
+<pre><code class="language-cpp">
+class CalculatorHandler : public CalculatorIf {
+ public:
+ CalculatorHandler() {}
+
+ void ping() {
+ printf("ping()\n");
+ }
+
+ int32_t add(const int32_t n1, const int32_t n2) {
+ printf("add(%d,%d)\n", n1, n2);
+ return n1 + n2;
+ }
+
+ int32_t calculate(const int32_t logid, const Work &work) {
+ printf("calculate(%d,{%d,%d,%d})\n", logid, work.op, work.num1, work.num2);
+ int32_t val;
+
+ switch (work.op) {
+ case Operation::ADD:
+ val = work.num1 + work.num2;
+ break;
+ case Operation::SUBTRACT:
+ val = work.num1 - work.num2;
+ break;
+ case Operation::MULTIPLY:
+ val = work.num1 * work.num2;
+ break;
+ case Operation::DIVIDE:
+ if (work.num2 == 0) {
+ InvalidOperation io;
+ io.what = work.op;
+ io.why = "Cannot divide by 0";
+ throw io;
+ }
+ val = work.num1 / work.num2;
+ break;
+ default:
+ InvalidOperation io;
+ io.what = work.op;
+ io.why = "Invalid Operation";
+ throw io;
+ }
+
+ SharedStruct ss;
+ ss.key = logid;
+ char buffer[12];
+ snprintf(buffer, sizeof(buffer), "%d", val);
+ ss.value = buffer;
+
+ log[logid] = ss;
+
+ return val;
+ }
+
+ void getStruct(SharedStruct &ret, const int32_t logid) {
+ printf("getStruct(%d)\n", logid);
+ ret = log[logid];
+ }
+
+ void zip() {
+ printf("zip()\n");
+ }
+
+protected:
+ map<int32_t, SharedStruct> log;
+
+};
+</code></pre>
+
+
+## Additional Information
+
+### Example ThreadPool Server
+<pre><code class="language-cpp">
+ shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(workerCount);
+ shared_ptr<PosixThreadFactory> threadFactory = shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
+ threadManager->threadFactory(threadFactory);
+ threadManager->start();
+ TThreadPoolServer server(processor,
+ serverTransport,
+ transportFactory,
+ protocolFactory,
+ threadManager);
+
+ TThreadedServer server(processor,
+ serverTransport,
+ transportFactory,
+ protocolFactory);
+
+ </code></pre>
+
\ No newline at end of file
Modified: thrift/site/content/tutorial/csharp.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/csharp.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/csharp.md (original)
+++ thrift/site/content/tutorial/csharp.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "CSharp"
+library_lang: "csharp"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-c">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/d.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/d.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/d.md (original)
+++ thrift/site/content/tutorial/d.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "D"
+library_lang: "d"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-d">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/delphi.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/delphi.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/delphi.md (original)
+++ thrift/site/content/tutorial/delphi.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Delphi"
+library_lang: "delphi"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-delphi">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/erl.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/erl.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/erl.md (original)
+++ thrift/site/content/tutorial/erl.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Erlang"
+library_lang: "erl"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code>
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/go.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/go.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/go.md (original)
+++ thrift/site/content/tutorial/go.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Go"
+library_lang: "go"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-c">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/hs.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/hs.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/hs.md (original)
+++ thrift/site/content/tutorial/hs.md Fri Sep 28 04:01:02 2012
@@ -1,3 +1,17 @@
---
title: "Haskell"
+library_lang: "hs"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-c">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/java.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/java.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/java.md (original)
+++ thrift/site/content/tutorial/java.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Java"
+library_lang: "java"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-java">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/javame.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/javame.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/javame.md (original)
+++ thrift/site/content/tutorial/javame.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Java Me"
+library_lang: "javame"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-java">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/js.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/js.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/js.md (original)
+++ thrift/site/content/tutorial/js.md Fri Sep 28 04:01:02 2012
@@ -1,5 +1,6 @@
---
title: "Javascript"
+library_lang: "js"
---
<%= render 'tutorial_intro' %>
Modified: thrift/site/content/tutorial/nodejs.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/nodejs.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/nodejs.md (original)
+++ thrift/site/content/tutorial/nodejs.md Fri Sep 28 04:01:02 2012
@@ -1,3 +1,18 @@
---
title: "Node.js"
+library_lang: "js:node"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-js">
+</code></pre>
+
+### Server
+
+
+## Additional Information
+
Modified: thrift/site/content/tutorial/ocaml.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/ocaml.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/ocaml.md (original)
+++ thrift/site/content/tutorial/ocaml.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "OCaml"
+library_lang: "ocaml"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-java">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/perl.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/perl.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/perl.md (original)
+++ thrift/site/content/tutorial/perl.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Perl"
+library_lang: "perl"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-php">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/php.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/php.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/php.md (original)
+++ thrift/site/content/tutorial/php.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "PHP"
+library_lang: "php"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-php">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/py.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/py.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/py.md (original)
+++ thrift/site/content/tutorial/py.md Fri Sep 28 04:01:02 2012
@@ -1,3 +1,17 @@
---
title: "Python"
+library_lang: "py"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-python">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/rb.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/rb.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/rb.md (original)
+++ thrift/site/content/tutorial/rb.md Fri Sep 28 04:01:02 2012
@@ -1,3 +1,17 @@
---
title: "Ruby"
+library_lang: "rb"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-ruby">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/content/tutorial/st.md
URL: http://svn.apache.org/viewvc/thrift/site/content/tutorial/st.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/content/tutorial/st.md (original)
+++ thrift/site/content/tutorial/st.md Fri Sep 28 04:01:02 2012
@@ -1,4 +1,18 @@
---
title: "Smalltalk"
+library_lang: "st"
---
+<%= render 'tutorial_intro' %>
+
+### Prerequisites
+
+### Client
+
+<pre><code class="language-c">
+</code></pre>
+
+### Server
+
+
+## Additional Information
Modified: thrift/site/layouts/tutorial_intro.md
URL: http://svn.apache.org/viewvc/thrift/site/layouts/tutorial_intro.md?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/layouts/tutorial_intro.md (original)
+++ thrift/site/layouts/tutorial_intro.md Fri Sep 28 04:01:02 2012
@@ -7,7 +7,7 @@ All Apache Thrift tutorials require that
1. Built and installed the Apache Thrift Compiler, see [installing Thrift](/docs/install/) for more details.
1. Generated the [tutorial.thrift](http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift) file as [discussed here](/tutorial/)
- thrift --gen js tutorial.thrift
+ thrift --gen <%= item[:library_lang] %> tutorial.thrift
1. Followed all prerequesets listed
Modified: thrift/site/publish/docs/idl/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/docs/idl/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/docs/idl/index.html (original)
+++ thrift/site/publish/docs/idl/index.html Fri Sep 28 04:01:02 2012
@@ -70,9 +70,9 @@
<p>The Thrift interface definition language (IDL) allows for the definition of <a href="/docs/types/">Thrift Types</a>. A Thrift IDL file is processed by the Thrift code generator to produce code for the various target languages to support the defined structs and services in the IDL file.</p>
-<p>= Description =</p>
+<h2>Description</h2>
-<p>''Under construction''</p>
+<p><em>Under construction</em></p>
<p>Here is a description of the Thrift IDL.</p>
@@ -80,195 +80,226 @@
<p>Every Thrift document contains 0 or more headers followed by 0 or more definitions.</p>
-<p>{{{[1] Document ::= Header* Definition*}}}</p>
+<pre><code>[1] Document ::= Header* Definition*
+</code></pre>
<h2>Header</h2>
<p>A header is either a Thrift include, a C++ include, or a namespace declaration.</p>
-<p>{{{[2] Header ::= Include | CppInclude | Namespace}}}</p>
+<pre><code>[2] Header ::= Include | CppInclude | Namespace
+</code></pre>
-<h2>Thrift Include</h2>
+<h3>Thrift Include</h3>
<p>An include makes all the symbols from another file visible (with a prefix) and adds corresponding include statements into the code generated for this Thrift document.</p>
-<p>{{{[3] Include ::= 'include' Literal}}}</p>
+<pre><code>[3] Include ::= 'include' Literal
+</code></pre>
<h3>C++ Include</h3>
<p>A C++ include adds a custom C++ include to the output of the C++ code generator for this Thrift document. </p>
-<p>{{{[4] CppInclude ::= 'cpp_include' Literal}}}</p>
+<pre><code>[4] CppInclude ::= 'cpp_include' Literal
+</code></pre>
<h3>Namespace</h3>
<p>A namespace declares which namespaces/package/module/etc. the type definitions in this file will be declared in for the target languages. The namespace scope indicates which language the namespace applies to; a scope of '*' indicates that the namespace applies to all target languages.</p>
-<p>{{{[5] Namespace ::= ( 'namespace' ( NamespaceScope Identifier ) |}}}<<br>>
-{{{ ( 'smalltalk.category' STIdentifier ) |}}}<<br>>
-{{{ ( 'smalltalk.prefix' Identifier ) ) |}}}<<br>>
-{{{ ( 'php<em>namespace' Literal ) |}}}<<br>>
-{{{ ( 'xsd</em>namespace' Literal )}}}</p>
+<pre><code>[5] Namespace ::= ( 'namespace' ( NamespaceScope Identifier ) |
+ ( 'smalltalk.category' STIdentifier ) |
+ ( 'smalltalk.prefix' Identifier ) ) |
+ ( 'php_namespace' Literal ) |
+ ( 'xsd_namespace' Literal )
-<p>{{{[6] NamespaceScope ::= '*' | 'cpp' | 'java' | 'py' | 'perl' | 'rb' | 'cocoa' | 'csharp'}}}</p>
+[6] NamespaceScope ::= '*' | 'cpp' | 'java' | 'py' | 'perl' | 'rb' | 'cocoa' | 'csharp'
+</code></pre>
-<p>NB: Smalltalk has two distinct types of namespace commands.
-''Can someone who knows Smalltalk explain why Smalltalk needs two different kinds of namespaces?''</p>
+<p>N.B.: Smalltalk has two distinct types of namespace commands.
+<em>Can someone who knows Smalltalk explain why Smalltalk needs two different kinds of namespaces?</em></p>
-<p>NB: The php_namespace directive will be deprecated at some point in the future in favor of the scoped syntax, but the scoped syntax is not yet supported for PHP.</p>
+<p>N.B.: The <code>php_namespace</code> directive will be deprecated at some point in the future in favor of the scoped syntax, but the scoped syntax is not yet supported for PHP.</p>
-<p>NB: The xsd_namespace directive has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged</p>
+<p>N.B.: The <code>xsd_namespace</code> directive has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged</p>
<h2>Definition</h2>
-<p>{{{[7] Definition ::= Const | Typedef | Enum | Senum | Struct | Exception | Service}}}</p>
+<pre><code>[7] Definition ::= Const | Typedef | Enum | Senum | Struct | Exception | Service
+</code></pre>
<h3>Const</h3>
-<p>{{{[8] Const ::= 'const' FieldType Identifier '=' ConstValue ListSeparator?}}}</p>
+<pre><code>[8] Const ::= 'const' FieldType Identifier '=' ConstValue ListSeparator?
+</code></pre>
<h3>Typedef</h3>
<p>A typedef creates an alternate name for a type.</p>
-<p>{{{[9] Typedef ::= 'typedef' DefinitionType Identifier}}}</p>
+<pre><code>[9] Typedef ::= 'typedef' DefinitionType Identifier
+</code></pre>
<h3>Enum</h3>
<p>An enum creates an enumerated type, with named values. If no constant value is supplied, the value is either 0 for the first element, or one greater than the preceding value for any subsequent element. Any constant value that is supplied must be non-negative.</p>
-<p>{{{[10] Enum ::= 'enum' Identifier '{' (Identifier ('=' IntConstant)? ListSeparator?)* '}'}}}</p>
+<pre><code>[10] Enum ::= 'enum' Identifier '{' (Identifier ('=' IntConstant)? ListSeparator?)* '}'
+</code></pre>
<h3>Senum</h3>
-<p>{{{[11] Senum ::= 'senum' Identifier '{' (Literal ListSeparator?)* '}'}}}</p>
+<pre><code>[11] Senum ::= 'senum' Identifier '{' (Literal ListSeparator?)* '}'
+</code></pre>
<h3>Struct</h3>
<p>Structs are the fundamental compositional type in Thrift. The name of each field must be unique within the struct.</p>
-<p>{{{[12] Struct ::= 'struct' Identifier 'xsd_all'? '{' Field* '}'}}}</p>
+<pre><code>[12] Struct ::= 'struct' Identifier 'xsd_all'? '{' Field* '}'
+</code></pre>
-<p>NB: The xsd_all keyword has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged</p>
+<p>N.B.: The <code>xsd_all</code> keyword has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged</p>
<h3>Exception</h3>
<p>Exceptions are similar to structs except that they are intended to integrate with the native exception handling mechanisms in the target languages. The name of each field must be unique within the exception.</p>
-<p>{{{[13] Exception ::= 'exception' Identifier '{' Field* '}' }}}</p>
+<pre><code>[13] Exception ::= 'exception' Identifier '{' Field* '}'
+</code></pre>
<h3>Service</h3>
<p>A service provides the interface for a set of functionality provided by a Thrift server. The interface is simply a list of functions. A service can extend another service, which simply means that it provides the functions of the extended service in addition to its own.</p>
-<p>{{{[14] Service ::= 'service' Identifier ( 'extends' Identifier )? '{' Function* '}'}}}</p>
+<pre><code>[14] Service ::= 'service' Identifier ( 'extends' Identifier )? '{' Function* '}'
+</code></pre>
<h2>Field</h2>
-<p>{{{[15] Field ::= FieldID? FieldReq? FieldType Identifier ('= ConstValue)? XsdFieldOptions ListSeparator?}}}</p>
+<pre><code>[15] Field ::= FieldID? FieldReq? FieldType Identifier ('= ConstValue)? XsdFieldOptions ListSeparator?
+</code></pre>
<h3>Field ID</h3>
-<p>{{{[16] FieldID ::= IntConstant ':'}}}</p>
+<pre><code>[16] FieldID ::= IntConstant ':'
+</code></pre>
<h3>Field Requiredness</h3>
-<p>{{{[17] FieldReq ::= 'required' | 'optional'}}}</p>
+<pre><code>[17] FieldReq ::= 'required' | 'optional'
+</code></pre>
<h3>XSD Options</h3>
-<p>NB: These have some internal purpose at Facebook but serve no current purpose in Thrift. Use of these options is strongly discouraged.</p>
+<p>N.B.: These have some internal purpose at Facebook but serve no current purpose in Thrift. Use of these options is strongly discouraged.</p>
-<p>{{{[18] XsdFieldOptions ::= 'xsd<em>optional'? 'xsd</em>nillable'? XsdAttrs?}}}</p>
+<pre><code>[18] XsdFieldOptions ::= 'xsd_optional'? 'xsd_nillable'? XsdAttrs?
-<p>{{{[19] XsdAttrs ::= 'xsd_attrs' '{' Field* '}'}}}</p>
+[19] XsdAttrs ::= 'xsd_attrs' '{' Field* '}'
+</code></pre>
<h2>Functions</h2>
-<p>{{{[20] Function ::= 'oneway'? FunctionType Identifier '(' Field* ')' Throws? ListSeparator?}}}</p>
+<pre><code>[20] Function ::= 'oneway'? FunctionType Identifier '(' Field* ')' Throws? ListSeparator?
-<p>{{{[21] FunctionType ::= FieldType | 'void'}}}</p>
+[21] FunctionType ::= FieldType | 'void'
-<p>{{{[22] Throws ::= 'throws' '(' Field* ')'}}}</p>
+[22] Throws ::= 'throws' '(' Field* ')'
+</code></pre>
<h2>Types</h2>
-<p>{{{[23] FieldType ::= Identifier | BaseType | ContainerType}}}</p>
+<pre><code>[23] FieldType ::= Identifier | BaseType | ContainerType
-<p>{{{[24] DefinitionType ::= BaseType | ContainerType}}}</p>
+[24] DefinitionType ::= BaseType | ContainerType
-<p>{{{[25] BaseType ::= 'bool' | 'byte' | 'i16' | 'i32' | 'i64' | 'double' |}}}<<br>>
-{{{ 'string' | 'binary' | 'slist'}}}</p>
+[25] BaseType ::= 'bool' | 'byte' | 'i16' | 'i32' | 'i64' | 'double' | 'string' | 'binary' | 'slist'
-<p>{{{[26] ContainerType ::= MapType | SetType | ListType}}}</p>
+[26] ContainerType ::= MapType | SetType | ListType
-<p>{{{[27] MapType ::= 'map' CppType? '<' FieldType ',' FieldType '>'}}}</p>
+[27] MapType ::= 'map' CppType? '<' FieldType ',' FieldType '>'
-<p>{{{[28] SetType ::= 'set' CppType? '<' FieldType '>'}}}</p>
+[28] SetType ::= 'set' CppType? '<' FieldType '>'
-<p>{{{[29] ListType ::= 'list' '<' FieldType '>' CppType?}}}</p>
+[29] ListType ::= 'list' '<' FieldType '>' CppType?
-<p>{{{[30] CppType ::= 'cpp_type' Literal}}}</p>
+[30] CppType ::= 'cpp_type' Literal
+</code></pre>
<h2>Constant Values</h2>
-<p>{{{[31] ConstValue ::= IntConstant | DoubleConstant | Literal | Identifier | ConstList | ConstMap}}}</p>
+<pre><code>[31] ConstValue ::= IntConstant | DoubleConstant | Literal | Identifier | ConstList | ConstMap
-<p>{{{[32] IntConstant ::= ('+' | '-')? Digit+}}}</p>
+[32] IntConstant ::= ('+' | '-')? Digit+
-<p>{{{[33] DoubleConstant ::= ('+' | '-')? Digit* ('.' Digit+)? ( ('E' | 'e') IntConstant )?}}}</p>
+[33] DoubleConstant ::= ('+' | '-')? Digit* ('.' Digit+)? ( ('E' | 'e') IntConstant )?
-<p>{{{[34] ConstList ::= '[' (ConstValue ListSeparator?)* ']'}}}</p>
+[34] ConstList ::= '[' (ConstValue ListSeparator?)* ']'
-<p>{{{[35] ConstMap ::= '{' (ConstValue ':' ConstValue ListSeparator?)* '}'}}}</p>
+[35] ConstMap ::= '{' (ConstValue ':' ConstValue ListSeparator?)* '}'
+</code></pre>
<h2>Basic Definitions</h2>
<h3>Literal</h3>
-<p>{{{[36] Literal ::= ('â' [^â]* 'â') | (â'â [^']* â'â)}}}</p>
+<pre><code>[36] Literal ::= ('"' [^"]* '"') | ("'" [^']* "'")
+</code></pre>
<h3>Identifier</h3>
-<p>{{{[37] Identifier ::= ( Letter | '<em>' ) ( Letter | Digit | '.' | '</em>' )*}}}</p>
+<pre><code>[37] Identifier ::= ( Letter | '_' ) ( Letter | Digit | '.' | '_' )*
-<p>{{{[38] STIdentifier ::= ( Letter | '<em>' ) ( Letter | Digit | '.' | '</em>' | '-' )*}}}</p>
+[38] STIdentifier ::= ( Letter | '_' ) ( Letter | Digit | '.' | '_' | '-' )*
+</code></pre>
<h3>List Separator</h3>
-<p>{{{[39] ListSeparator ::= ',' | ';'}}}</p>
+<pre><code>[39] ListSeparator ::= ',' | ';'
+</code></pre>
<h3>Letters and Digits</h3>
-<p>{{{[40] Letter ::= ['A'-'Z'] | ['a'-'z']}}}</p>
+<pre><code>[40] Letter ::= ['A'-'Z'] | ['a'-'z']
-<p>{{{[41] Digit ::= ['0'-'9']}}}</p>
+[41] Digit ::= ['0'-'9']
+</code></pre>
-<h1>Examples</h1>
+<h2>Examples</h2>
-<p>Here are some examples of Thrift definitions, using the Thrift IDL:
- * [[http://svn.apache.org/repos/asf/thrift/trunk/test/ThriftTest.thrift | ThriftTest.thrift]] used by the Thrift TestFramework
- * Thrift [[http://svn.apache.org/repos/asf/thrift/trunk/tutorial/ | tutorial ]]
- * Facebook's [[http://svn.apache.org/repos/asf/thrift/trunk/contrib/fb303/if/fb303.thrift | fb303.thrift]]
- * [[http://cassandra.apache.org/ | Apache Cassandra's]] Thrift IDL: [[http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?view=co | cassandra.thrift]]
- * [[http://www.evernote.com/about/developer/api/ | Evernote API]]</p>
+<p>Here are some examples of Thrift definitions, using the Thrift IDL:</p>
-<h1>To Do/Questions</h1>
+<ul>
+<li>
+<a href="http://svn.apache.org/repos/asf/thrift/trunk/test/ThriftTest.thrift">ThriftTest.thrift</a> used by the Thrift TestFramework</li>
+<li>Thrift <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/">tutorial</a>
+</li>
+<li>Facebook's <a href="http://svn.apache.org/repos/asf/thrift/trunk/contrib/fb303/if/fb303.thrift">fb303.thrift</a>
+</li>
+<li>
+<a href="http://cassandra.apache.org/">Apache Cassandra's</a> Thrift IDL: <a href="http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?view=co">cassandra.thrift</a>
+</li>
+<li><a href="http://www.evernote.com/about/developer/api/">Evernote API</a></li>
+</ul><h2>To Do/Questions</h2>
-<p>Initialization of Base Types for all Languages?
- * Do all Languages initialize them to 0, bool=false and string=ââ? or null, undefined?</p>
+<p>Initialization of Base Types for all Languages?</p>
-<p>Why does position of {{{CppType}}} vary between {{{SetType}}} and {{{ListType}}}?
- * std::set does sort the elements automatically, that's the design. see <a href="/docs/types/">Thrift Types</a> or http://www.cplusplus.com/reference/stl/set/ for further details
- * The question is, how other languages are doing that? What about custom objects, do they have a Compare function the set the order correctly?</p>
+<ul>
+<li>Do all Languages initialize them to 0, bool=false and string=ââ? or null, undefined?</li>
+</ul><p>Why does position of <code>CppType</code> vary between <code>SetType</code> and <code>ListType</code>?</p>
-<p>Why can't {{{DefinitionType}}} be the same as {{{FieldType}}} (ie: include {{{Identifier}}})?</p>
+<ul>
+<li>std::set does sort the elements automatically, that's the design. see <a href="/docs/types/">Thrift Types</a> or the <a href="http://www.cplusplus.com/reference/stl/set/">C++ std:set reference</a> for further details</li>
+<li>The question is, how other languages are doing that? What about custom objects, do they have a Compare function the set the order correctly?</li>
+</ul><p>Why can't <code>DefinitionType</code> be the same as <code>FieldType</code> (i.e. include <code>Identifier</code>)?</p>
-<p>Examine the {{{smalltalk.prefix}}} and {{{smalltalk.category}}} status (esp {{{smalltalk.category}}}, which takes {{{STIdentifier}}} as its argument)â¦</p>
+<p>Examine the <code>smalltalk.prefix</code> and <code>smalltalk.category</code> status (esp <code>smalltalk.category</code>, which takes <code>STIdentifier</code> as its argument)â¦</p>
-<p>What to do about {{{ListSeparator}}}? Do we really want to be as lax as we currently are?</p>
+<p>What to do about <code>ListSeparator</code>? Do we really want to be as lax as we currently are?</p>
-<p>Should {{{Field*}}} really be {{{Field+}}} in {{{Struct}}}, {{{Enum}}}, etc.?</p>
+<p>Should <code>Field*</code> really be <code>Field+</code> in <code>Struct</code>, <code>Enum</code>, etc.?</p>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/as3/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/as3/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/as3/index.html (original)
+++ thrift/site/publish/tutorial/as3/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>As3 Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen as3 tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-java"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/c_glib/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/c_glib/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/c_glib/index.html (original)
+++ thrift/site/publish/tutorial/c_glib/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>C Glib Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen c_glib tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-java"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/cocoa/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/cocoa/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/cocoa/index.html (original)
+++ thrift/site/publish/tutorial/cocoa/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Objective-c Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen cocoa tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-c"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/cpp/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/cpp/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/cpp/index.html (original)
+++ thrift/site/publish/tutorial/cpp/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,172 @@
</div>
<div class="container">
-
+ <h2>C++ Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen cpp tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-cpp"> shared_ptr socket(<span style="color:#080;font-weight:bold">new</span> TSocket(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">localhost</span><span style="color:#710">"</span></span>, <span style="color:#00D">9090</span>));
+ shared_ptr transport(<span style="color:#080;font-weight:bold">new</span> TBufferedTransport(socket));
+ shared_ptr protocol(<span style="color:#080;font-weight:bold">new</span> TBinaryProtocol(transport));
+ CalculatorClient client(protocol);
+
+ <span style="color:#080;font-weight:bold">try</span> {
+ transport->open();
+
+ client.ping();
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">ping()</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>);
+
+ int32_t sum = client.add(<span style="color:#00D">1</span>,<span style="color:#00D">1</span>);
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">1+1=%d</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, sum);
+
+ Work work;
+ work.op = Operation::DIVIDE;
+ work.num1 = <span style="color:#00D">1</span>;
+ work.num2 = <span style="color:#00D">0</span>;
+
+ <span style="color:#080;font-weight:bold">try</span> {
+ int32_t quotient = client.calculate(<span style="color:#00D">1</span>, work);
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Whoa? We can divide by zero!</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>);
+ } <span style="color:#080;font-weight:bold">catch</span> (InvalidOperation &io) {
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">InvalidOperation: %s</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, io.why.c_str());
+ }
+
+ work.op = Operation::SUBTRACT;
+ work.num1 = <span style="color:#00D">15</span>;
+ work.num2 = <span style="color:#00D">10</span>;
+ int32_t diff = client.calculate(<span style="color:#00D">1</span>, work);
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">15-10=%d</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, diff);
+
+ <span style="color:#777">// Note that C++ uses return by reference for complex types to avoid</span>
+ <span style="color:#777">// costly copy construction</span>
+ SharedStruct ss;
+ client.getStruct(ss, <span style="color:#00D">1</span>);
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Check log: %s</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, ss.value.c_str());
+
+ transport->close();
+ } <span style="color:#080;font-weight:bold">catch</span> (TException &tx) {
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">ERROR: %s</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, tx.what());
+ }</code></pre>
+
+<h3>Server</h3>
+
+<pre><code class="language-cpp"> shared_ptr protocolFactory(<span style="color:#080;font-weight:bold">new</span> TBinaryProtocolFactory());
+ shared_ptr handler(<span style="color:#080;font-weight:bold">new</span> CalculatorHandler());
+ shared_ptr processor(<span style="color:#080;font-weight:bold">new</span> CalculatorProcessor(handler));
+ shared_ptr serverTransport(<span style="color:#080;font-weight:bold">new</span> TServerSocket(<span style="color:#00D">9090</span>));
+ shared_ptr transportFactory(<span style="color:#080;font-weight:bold">new</span> TBufferedTransportFactory());
+
+ TSimpleServer server(processor,
+ serverTransport,
+ transportFactory,
+ protocolFactory);
+
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Starting the server...</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>);
+ server.serve();</code></pre>
+
+<h3>Server Handler</h3>
+
+<pre><code class="language-cpp"><span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">CalculatorHandler</span> : <span style="color:#088;font-weight:bold">public</span> CalculatorIf {
+ <span style="color:#088;font-weight:bold">public</span>:
+ CalculatorHandler() {}
+
+ <span style="color:#088;font-weight:bold">void</span> ping() {
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">ping()</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>);
+ }
+
+ int32_t add(<span style="color:#088;font-weight:bold">const</span> int32_t n1, <span style="color:#088;font-weight:bold">const</span> int32_t n2) {
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">add(%d,%d)</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, n1, n2);
+ <span style="color:#080;font-weight:bold">return</span> n1 + n2;
+ }
+
+ int32_t calculate(<span style="color:#088;font-weight:bold">const</span> int32_t logid, <span style="color:#088;font-weight:bold">const</span> Work &work) {
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">calculate(%d,{%d,%d,%d})</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, logid, work.op, work.num1, work.num2);
+ int32_t val;
+
+ <span style="color:#080;font-weight:bold">switch</span> (work.op) {
+ <span style="color:#080;font-weight:bold">case</span> Operation::ADD:
+ val = work.num1 + work.num2;
+ <span style="color:#080;font-weight:bold">break</span>;
+ <span style="color:#080;font-weight:bold">case</span> Operation::SUBTRACT:
+ val = work.num1 - work.num2;
+ <span style="color:#080;font-weight:bold">break</span>;
+ <span style="color:#080;font-weight:bold">case</span> Operation::MULTIPLY:
+ val = work.num1 * work.num2;
+ <span style="color:#080;font-weight:bold">break</span>;
+ <span style="color:#080;font-weight:bold">case</span> Operation::DIVIDE:
+ <span style="color:#080;font-weight:bold">if</span> (work.num2 == <span style="color:#00D">0</span>) {
+ InvalidOperation io;
+ io.what = work.op;
+ io.why = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Cannot divide by 0</span><span style="color:#710">"</span></span>;
+ <span style="color:#080;font-weight:bold">throw</span> io;
+ }
+ val = work.num1 / work.num2;
+ <span style="color:#080;font-weight:bold">break</span>;
+ <span style="color:#080;font-weight:bold">default</span>:
+ InvalidOperation io;
+ io.what = work.op;
+ io.why = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Invalid Operation</span><span style="color:#710">"</span></span>;
+ <span style="color:#080;font-weight:bold">throw</span> io;
+ }
+
+ SharedStruct ss;
+ ss.key = logid;
+ <span style="color:#0a5;font-weight:bold">char</span> buffer[<span style="color:#00D">12</span>];
+ snprintf(buffer, <span style="color:#080;font-weight:bold">sizeof</span>(buffer), <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">%d</span><span style="color:#710">"</span></span>, val);
+ ss.value = buffer;
+
+ log[logid] = ss;
+
+ <span style="color:#080;font-weight:bold">return</span> val;
+ }
+
+ <span style="color:#088;font-weight:bold">void</span> getStruct(SharedStruct &ret, <span style="color:#088;font-weight:bold">const</span> int32_t logid) {
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">getStruct(%d)</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>, logid);
+ ret = log[logid];
+ }
+
+ <span style="color:#088;font-weight:bold">void</span> zip() {
+ printf(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">zip()</span><span style="color:#b0b">\n</span><span style="color:#710">"</span></span>);
+ }
+
+<span style="color:#088;font-weight:bold">protected</span>:
+ map log;
+
+};</code></pre>
+
+<h2>Additional Information</h2>
+
+<h3>Example ThreadPool Server</h3>
+
+<pre><code class="language-cpp"> shared_ptr threadManager = ThreadManager::newSimpleThreadManager(workerCount);
+ shared_ptr threadFactory = shared_ptr(<span style="color:#080;font-weight:bold">new</span> PosixThreadFactory());
+ threadManager->threadFactory(threadFactory);
+ threadManager->start();
+ TThreadPoolServer server(processor,
+ serverTransport,
+ transportFactory,
+ protocolFactory,
+ threadManager);
+
+ TThreadedServer server(processor,
+ serverTransport,
+ transportFactory,
+ protocolFactory);</code></pre>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/csharp/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/csharp/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/csharp/index.html (original)
+++ thrift/site/publish/tutorial/csharp/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>CSharp Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen csharp tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-c"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/d/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/d/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/d/index.html (original)
+++ thrift/site/publish/tutorial/d/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>D Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen d tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-d"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/delphi/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/delphi/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/delphi/index.html (original)
+++ thrift/site/publish/tutorial/delphi/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Delphi Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen delphi tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-delphi"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/erl/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/erl/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/erl/index.html (original)
+++ thrift/site/publish/tutorial/erl/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,31 @@
</div>
<div class="container">
-
+ <h2>Erlang Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen erl tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code>
+</code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/go/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/go/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/go/index.html (original)
+++ thrift/site/publish/tutorial/go/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Go Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen go tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-c"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/hs/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/hs/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/hs/index.html (original)
+++ thrift/site/publish/tutorial/hs/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Haskell Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen hs tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-c"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/java/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/java/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/java/index.html (original)
+++ thrift/site/publish/tutorial/java/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Java Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen java tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-java"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/javame/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/javame/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/javame/index.html (original)
+++ thrift/site/publish/tutorial/javame/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Java Me Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen javame tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-java"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/nodejs/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/nodejs/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/nodejs/index.html (original)
+++ thrift/site/publish/tutorial/nodejs/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Node.js Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen js:node tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-js"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/ocaml/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/ocaml/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/ocaml/index.html (original)
+++ thrift/site/publish/tutorial/ocaml/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>OCaml Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen ocaml tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-java"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/perl/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/perl/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/perl/index.html (original)
+++ thrift/site/publish/tutorial/perl/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Perl Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen perl tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-php"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/php/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/php/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/php/index.html (original)
+++ thrift/site/publish/tutorial/php/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>PHP Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen php tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-php"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/py/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/py/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/py/index.html (original)
+++ thrift/site/publish/tutorial/py/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Python Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen py tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-python"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/rb/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/rb/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/rb/index.html (original)
+++ thrift/site/publish/tutorial/rb/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Ruby Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen rb tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-ruby"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>
Modified: thrift/site/publish/tutorial/st/index.html
URL: http://svn.apache.org/viewvc/thrift/site/publish/tutorial/st/index.html?rev=1391291&r1=1391290&r2=1391291&view=diff
==============================================================================
--- thrift/site/publish/tutorial/st/index.html (original)
+++ thrift/site/publish/tutorial/st/index.html Fri Sep 28 04:01:02 2012
@@ -66,7 +66,30 @@
</div>
<div class="container">
-
+ <h2>Smalltalk Tutorial</h2>
+
+<hr><h3>Introduction</h3>
+
+<p>All Apache Thrift tutorials require that you have:</p>
+
+<ol>
+<li>Built and installed the Apache Thrift Compiler, see <a href="/docs/install/">installing Thrift</a> for more details. </li>
+<li>
+<p>Generated the <a href="http://svn.apache.org/repos/asf/thrift/trunk/tutorial/tutorial.thrift">tutorial.thrift</a> file as <a href="/tutorial/">discussed here</a></p>
+
+<pre><code>thrift --gen st tutorial.thrift
+</code></pre>
+</li>
+<li><p>Followed all prerequesets listed </p></li>
+</ol><h3>Prerequisites</h3>
+
+<h3>Client</h3>
+
+<pre><code class="language-c"></code></pre>
+
+<h3>Server</h3>
+
+<h2>Additional Information</h2>
</div>
<div class="container">
<hr>