Navigation Menu

Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 28, 2014
1 parent 7caedbb commit 5ad7fa3
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 39 deletions.
56 changes: 33 additions & 23 deletions _po/ja/tutorial/plugin-development/adapter/index.po
Expand Up @@ -27,9 +27,9 @@ msgid "Learning steps to develop a Droonga plugin by yourself."
msgstr ""

msgid ""
"This page focuses on the adaption phase for Droonga plugins.\n"
"At the last, wraps up them to make a small practical plugin named `store-searc"
"h`, for the adaption phase."
"This page focuses on the \"adaption\" by Droonga plugins.\n"
"At the last, we create a new command `storeSearch` based on the existing `sear"
"ch` command, with a small practical plugin."
msgstr ""

msgid "## Precondition"
Expand Down Expand Up @@ -123,7 +123,7 @@ msgid ""
"~~~"
msgstr ""

msgid "This plugin does nothing except registering itself to Droonga."
msgid "This plugin does nothing except registering itself to the Droonga Engine."
msgstr ""

msgid ""
Expand Down Expand Up @@ -165,7 +165,7 @@ msgid ""
" plugin dependencies by your hand (for now)."
msgstr ""

msgid "### Run"
msgid "### Run and test"
msgstr ""

msgid ""
Expand All @@ -182,10 +182,9 @@ msgid ""
"~~~"
msgstr ""

msgid "### Test"
msgstr ""

msgid "Check if the engine is working. First, create a request as a JSON."
msgid ""
"Then, verify that the engine is correctly working.\n"
"First, create a request as a JSON."
msgstr ""

msgid "search-columbus.json:"
Expand Down Expand Up @@ -224,8 +223,9 @@ msgstr ""

msgid ""
"This is corresponding to the example to search \"Columbus\" in the [basic tutori"
"al][]. Note that the request for the Protocol Adapter is encapsulated in `\"bod"
"y\"` element."
"al][].\n"
"Note that the request for the Protocol Adapter is encapsulated in `\"body\"` ele"
"ment."
msgstr ""

msgid "Send the request to engine with `droonga-request`:"
Expand Down Expand Up @@ -497,6 +497,9 @@ msgid ""
"pter/) for more details."
msgstr ""

msgid "### Run"
msgstr ""

msgid "Let's restart fluentd:"
msgstr ""

Expand Down Expand Up @@ -634,7 +637,7 @@ msgid ""
"~~~"
msgstr ""

msgid "## Translation for both incoming and outgoing messages"
msgid "## Adaption for both incoming and outgoing messages"
msgstr ""

msgid ""
Expand All @@ -649,14 +652,15 @@ msgid ""
" new plugin named `store-search`."
msgstr ""

msgid "### Accept simple requests"
msgid "### Accepting of simple requests"
msgstr ""

msgid ""
"First, create the `store-searach` plugin. Remember, you must put codes into a "
"file which has the name same to the plugin now you are creating. So, the file "
"is `store-search.rb` in the `droonga/plugins` directory. Then define your `Sto"
"reSearchPlugin` as follows:"
"First, create the `store-searach` plugin.\n"
"Remember, you must put codes into a file which has the name same to the plugin"
" now you are creating.\n"
"So, the file is `store-search.rb` in the `droonga/plugins` directory. Then def"
"ine your `StoreSearchPlugin` as follows:"
msgstr ""

msgid "lib/droonga/plugins/store-search.rb:"
Expand Down Expand Up @@ -724,8 +728,8 @@ msgid ""
msgstr ""

msgid ""
"Then update catalog.json to activate the plugin. Remove the `sample-logger` pl"
"ugin previously created."
"Then update your `catalog.json` to activate the plugin.\n"
"Remove the `sample-logger` plugin previously created."
msgstr ""

msgid ""
Expand Down Expand Up @@ -820,7 +824,7 @@ msgid ""
"the method `adapt_input`."
msgstr ""

msgid "### Return simple response"
msgid "### Returning of simple responses"
msgstr ""

msgid ""
Expand Down Expand Up @@ -921,9 +925,15 @@ msgid "## Conclusion"
msgstr "## まとめ"

msgid ""
"We have learned how to create an addon working around the adaption phase, how "
"to receive and modify messages, both of incoming and outgoing. See also the [r"
"eference manual](../../../reference/plugin/adapter/) for more details."
"We have learned how to add a new command based only on a custom adapter and an"
" existing command.\n"
"In the process, we also have learned how to receive and modify messages, both "
"of incoming and outgoing."
msgstr ""

msgid ""
"See also the [reference manual](../../../reference/plugin/adapter/) for more d"
"etails."
msgstr ""

msgid ""
Expand Down
5 changes: 4 additions & 1 deletion _po/ja/tutorial/plugin-development/handler/index.po
Expand Up @@ -694,7 +694,10 @@ msgstr ""
msgid "## Conclusion"
msgstr "## まとめ"

msgid "We have learned how to create plugins work in handling phrase."
msgid ""
"We have learned how to add a new simple command working around the data.\n"
"In the process, we also have learned how to create plugins working in the hand"
"ling phrase."
msgstr ""

msgid ""
Expand Down
34 changes: 20 additions & 14 deletions ja/tutorial/plugin-development/adapter/index.md
Expand Up @@ -19,8 +19,8 @@ layout: en

Learning steps to develop a Droonga plugin by yourself.

This page focuses on the adaption phase for Droonga plugins.
At the last, wraps up them to make a small practical plugin named `store-search`, for the adaption phase.
This page focuses on the "adaption" by Droonga plugins.
At the last, we create a new command `storeSearch` based on the existing `search` command, with a small practical plugin.

## 前提条件

Expand Down Expand Up @@ -83,7 +83,7 @@ module Droonga
end
~~~

This plugin does nothing except registering itself to Droonga.
This plugin does nothing except registering itself to the Droonga Engine.

* The `sample-logger` is the name of the plugin itself. You'll use it in your `catalog.json`, to activate the plugin.
* As the example above, you must define your plugin as a module.
Expand All @@ -109,7 +109,7 @@ catalog.json:

Note: you must place `"sample-logger"` before `"search"`, because the `sample-logger` plugin depends on the `search`. Droonga Engine applies plugins at the adaption phase in the order defined in the `catalog.json`, so you must resolve plugin dependencies by your hand (for now).

### Run
### Run and test

Let's get Droonga started.
Note that you need to specify `./lib` directory in `RUBYLIB` environment variable in order to make ruby possible to find your plugin.
Expand All @@ -119,9 +119,8 @@ Note that you need to specify `./lib` directory in `RUBYLIB` environment variabl
# RUBYLIB=./lib fluentd --config fluentd.conf --log fluentd.log --daemon fluentd.pid
~~~

### Test

Check if the engine is working. First, create a request as a JSON.
Then, verify that the engine is correctly working.
First, create a request as a JSON.

search-columbus.json:

Expand Down Expand Up @@ -154,7 +153,8 @@ search-columbus.json:
}
~~~

This is corresponding to the example to search "Columbus" in the [basic tutorial][]. Note that the request for the Protocol Adapter is encapsulated in `"body"` element.
This is corresponding to the example to search "Columbus" in the [basic tutorial][].
Note that the request for the Protocol Adapter is encapsulated in `"body"` element.

Send the request to engine with `droonga-request`:

Expand Down Expand Up @@ -476,17 +476,19 @@ The results in `fluentd.log` will be like this:
~~~


## Translation for both incoming and outgoing messages
## Adaption for both incoming and outgoing messages

We have learned the basics of plugins for the adaption phase so far.
Let's try to build more practical plugin.

You may feel the Droonga's `search` command is too flexible for your purpose.
Here, we're going to add our own `storeSearch` command to wrap the `search` command in order to provide an application-specific and simple interface, with a new plugin named `store-search`.

### Accept simple requests
### Accepting of simple requests

First, create the `store-searach` plugin. Remember, you must put codes into a file which has the name same to the plugin now you are creating. So, the file is `store-search.rb` in the `droonga/plugins` directory. Then define your `StoreSearchPlugin` as follows:
First, create the `store-searach` plugin.
Remember, you must put codes into a file which has the name same to the plugin now you are creating.
So, the file is `store-search.rb` in the `droonga/plugins` directory. Then define your `StoreSearchPlugin` as follows:

lib/droonga/plugins/store-search.rb:

Expand Down Expand Up @@ -544,7 +546,8 @@ end

(Note: `input_message.pattern` is for Droonga 1.0.0 and later. On Droonga 0.9.9, you have to use a deprecated configuration `message.input_pattern` instead.)

Then update catalog.json to activate the plugin. Remove the `sample-logger` plugin previously created.
Then update your `catalog.json` to activate the plugin.
Remove the `sample-logger` plugin previously created.

catalog.json:

Expand Down Expand Up @@ -620,7 +623,7 @@ Now we can perform store search with simple requests.

Note: look at the `"type"` of the response message. Now it became `"storeSearch.result"`, from `"search.result"`. Because it is triggered from the incoming message with the type `"storeSearch"`, the outgoing message has the type `"(incoming command).result"` automatically. In other words, you don't have to change the type of the outgoing messages, like `input_message.type = "search"` in the method `adapt_input`.

### Return simple response
### Returning of simple responses

Second, let's return results in more simple way: just an array of the names of stores.

Expand Down Expand Up @@ -693,7 +696,10 @@ In the way just described, we can use adapter to implement the application speci

## まとめ

We have learned how to create an addon working around the adaption phase, how to receive and modify messages, both of incoming and outgoing. See also the [reference manual](../../../reference/plugin/adapter/) for more details.
We have learned how to add a new command based only on a custom adapter and an existing command.
In the process, we also have learned how to receive and modify messages, both of incoming and outgoing.

See also the [reference manual](../../../reference/plugin/adapter/) for more details.


[basic tutorial]: ../../basic/
Expand Down
3 changes: 2 additions & 1 deletion ja/tutorial/plugin-development/handler/index.md
Expand Up @@ -532,7 +532,8 @@ This means that 4 or some records are deleted from each partitions.

## まとめ

We have learned how to create plugins work in handling phrase.
We have learned how to add a new simple command working around the data.
In the process, we also have learned how to create plugins working in the handling phrase.


[adapter]: ../adapter
Expand Down

0 comments on commit 5ad7fa3

Please sign in to comment.