翻譯:Linvo
轉帖請註明出處!
官方網站:http://www.ape-project.org
===============================
Getting Started with APE
You will find on this page all the informations you need to get started with the APE Project. You were wondering how to use APE ? This place is for you.
Don't hesitate to join our IRC Channel to ask questions : #ape-project@irc.freenode.net
APE起步
該頁麵包含了你打算開始使用APE項目所需要的所有資訊。你正想知道怎麼使用APE?這裡為你準備好了。
加入我們的IRC頻道提問吧,不要猶豫:#ape-project@irc.freenode.net
What is APE ?
APE (Ajax Push Engine) is an Open Source technology allowing you to do real time data streaming through a web browser with no applets and no plugins. The project is divided in two part, the APE Server and the APE JavaScript Framework.
The APE Server written in the C language enables data to be pushed to Rich Internet Application, while the APE JavaScript Framework (JSF) receive and send back data, deal them and display them.
APE是什嗎?
APE(Ajax推送引擎)是一個開源技術,它可以幫你實現通過Web瀏覽器的即時資料流傳輸,而無需任何外掛程式和小應用程式。該項目分為兩個部分:APE伺服器和APE JavaScript 架構。
APE伺服器是個用C語言寫的程式,支援向富Internet應用程式推送資料。而APE JavaScript架構(JSF)接收和發送資料,並處理和顯示它們。
What do I need to start using APE ?
The first thing you need to start using APE is to have knowledge in JavaScript programming.
Moreover, you will need a Linux dedicated server in order to install the APE Server. (For now, the APE Server only installs on Linux 2.6.16+ Kernel)
使用APE前的準備
開始使用APE前首先你需要具備一定JavaScript編程知識。
此外,你還需要個準備安裝APE伺服器的Linux伺服器。(現在的APE伺服器只支援2.6.16以上核心的Linux)
How do I run my own APE Server ?
There are two different ways to use the APE Server on a dedicated server :
APE has his own dedicated IP in order to use port 80 (See : How to configure the APE Server on port 80 ?)
APE is used on a server where it gets along with Apache (See : How to configure the APE Server with Apache ?)
Once you know what option you could (or want) to use, you'll need to download the lastest build of the APE Server, and follow the Setup Manual. Within few steps you will be able to start creating your own real time web application !
Notice that the first choice is highly more scalable (since data are not proxied through Apache).
我該怎麼運行自己的APE伺服器?
這有兩個不同方法來讓APE伺服器運行:
APE使用它自己的IP,從而使用80連接埠(看這裡:怎麼在80連接埠配置APE伺服器?)
APE使用在一個帶有Apache的伺服器上(看這裡:怎麼通過Apache配置APE伺服器?)
一旦你知道你要使用的選項,你需要下載最新版的APE伺服器,然後參考安裝手冊。經過簡單幾步後,你就可以開始建立你自己的即時Web應用了!
注意:第一個選擇是被推薦的(自從不再通過Apache來代理資料)。
And what about JavaScript ?
Now your brand new APE Server is perfectly working, you may need to deal with the front end ! But, how do I communicate with the APE Server, you may ask ?
As for that, we build a lightweight JavaScript Framework, that enables you to deal with all the server actions, send data to it, and real-time display those data in your Rich Internet Application.
The JSF, is composed of a Core and Plugins. The Core is based on Mootools, but however plugins can be written with the use of the framework of your choice ! (Jquery, Dojo...)
You do not need to care about the scary "XML HTTP Requests" and "How do I receive the data", the APE JSF handles everything ! It's now time to write your first plugin, and build your own real time application !
JavaScript呢?
現在你的新APE伺服器已經完美的工作了,你需要處理前後端的問題了!但是,你可能會問:我怎麼通過APE伺服器來通訊呢?
為解決它,我們建立了一個輕量級的JavaScript架構,它支援你去處理所有的伺服器動作、發送資料,以及那些資料在你的富Internet應用的即時顯示。
這個JSF是由一個核心和一些外掛程式組成。核心是基於Mootools,但是外掛程式可以使用你喜歡的任何架構來編寫!(JQuery,Dojo。。。)
你不必擔心諸如“XML HTTP Requests”和“我怎麼接收資料”這些問題,APE JSF會處理好每件事!是時候去編寫你的第一個外掛程式和建立第一個即時應用的時候了!
The APE Protocol
The APE Protocol is the gateway of the communication between the APE Server and the APE JavaScript Framework. The basics of the Protocol works with RAW and Commands.
APE協議
APE協議是位於APE伺服器和APE JavaScript架構間的關卡。協議的基礎是RAW和Commands。
Commands
The APE Server is controllable via Commands sent by an external client (for exemple the APE JavaScript Framework. The Commands are sent via an HTTP request to the Server via GET or POST methods.
Commands
APE伺服器通過擴充用戶端(例如APE JavaScript架構)發來的Commands來控制。Commands通過GET或POST方法,通過一個HTTP請求來發送。
RAW
The answers of the server are called RAW and are sent as a JSON Object. Here is a non exhaustive list of RAWs :
Received message, Login, Error, libape-controller data...
RAW
伺服器的應答稱為RAW,並且以一個JSON對象來發送。這是關於RAWs的簡單列表:
接收資訊,登入,錯誤,控制資料。。。
Let's get started : First APE Tutorial
Now you're familiar with the global working of the APE JSF, you should try to develop your first APE application while following our First Tutorial.
開始行動吧:APE入門教程
現在你對APE JSF全域工作已經熟悉了,可以通過我們的入門教程試著開發你的第一個APE應用了。