--- a/README.md Mon Dec 26 22:53:50 2011 +0100
+++ b/README.md Mon Jan 23 00:48:55 2012 +0100
@@ -45,7 +45,7 @@
\_\_DIR\_\_.'/cache/task/wikitag',
));
-* Since WikiTagBundle builds its own document class from the host app's document class, you need to tell in config.yml what _text_ fields will be used in this class.
+* Since WikiTagBundle builds its own document class from the host app's document class, you need to tell in config.yml what is the host app's document class and what _text_ fields will be used in this class.
These fields are used for searching and to calculate the tag's weight. Example :
wiki_tag:
@@ -60,6 +60,13 @@
description:
type: text
weight: 0.5
+The 'document_id_column' option is used to indicate the primary key column used by the host app's document class. We are currently limited to non composite primary keys.
+A field definition has the following format:
+<field name>:
+ type: <string or text> : field type. default : text
+ length: <int> : the length of the field. ignored if field type is text
+ accessor: <field name or method name> : the field name in the host app's document class, or the name of the method used to access the field value. If not found it will try ta add 'get' in frint of the name. Default : the field name
+ weight: <float> : the weight used for this field to calculate the score of each tag. default : 1.0
* Add the WikiTag routes to your routing.yml :
@@ -70,8 +77,8 @@
* Run the commands :
php app/console wikitag:generate-document-class (no need to explain)
- php app/console wikitag:schema:update (also runs php app/console doctrine:schema:update)
- php app/console wikitag:sync-doc (fills the database with the datas from the host document class to the wikitag document class)
+ php app/console wikitag:schema:update (also replace and runs php app/console doctrine:schema:update)
+ php app/console wikitag:sync-doc (fills the database with the datas from the host document class to the wikitag document class. this command is needed only if the database was not empty)
* Your database is ready. You can now include the table of tags in a template. Do not forget css and javascript (and php app/console assets:install). Example :
@@ -179,7 +186,62 @@
{% render "WikiTagBundle:WikiTag:addJavascriptForContextSearch" with {'context_name': 'some_divs'} %}
{% endblock %}
+## More configuration 3 : ignore wikipedia errors
+This option allows to ignore wikipedia errors instead of raising an exception. The error is logged with an ERROR level and the tag is added/updated but not semantized.
+
+ wiki_tag:
+ ...
+ ignore_wikipedia_error: true
+
+## Services
+
+### Document Service : wiki_tag.document - IRI\Bundle\WikiTagBundle\Services\DocumentService
+The document service gathers methods to manage tags on a given document. all these methods must be called after the host app's document(s) object has been created and flushed.
+
+* addTags : add a tag or a list pf tags to a document. For each new tag, wikipedia will be queried.
+
+* copyTags : copy the tags list from one document to the other.
+
+* reorderTags : reorder a document tags.
+
+* getTagsLabels : get the list of tag labels from one document.
+### Search service : wiki_tag.search - IRI\Bundle\WikiTagBundle\Services\SearchService
+The search service allows searching documents
+
+* getTagCloud : returns a weighted list of tag labels. The weight of the label is the number of documents tagged with this label. The list is sorted by descending weights.
+
+* search : search documents.
+
+## Commands
+This bundle provides a number of commans that helps in the tags management.
+
+### wikitag:schema:create
+Command to create the database schema. Equivalent to the doctrine:schema:create command.
+It fully replaces the doctrine:schema:create and *must* be run instead of the doctrine:schema:create command.
+### wikitag:schema:update
+Command to update the database schema. Equivalent to the doctrine:schema:update command.
+It fully replaces the doctrine:schema:update and *must* be run instead of the doctrine:schema:update command.
+
+
+### wikitag:create-fulltext-indexes
+Generate the sql to create the full text index on the database. This command is not destined to be directly called.
+
+### wikitag:generate-document-class
+Generate the WikiTagBundle document class. This command should not be directly called.
+
+### wikitag:purge-tags
+Removes tags associated to no documents.
+
+### wikitag:query-wikipedia
+Query wikipedia for informations on tags.
+
+### wikitag:reorder-tags
+Automatically reorder documents tags. For each documents treated, each tag of the document is scored according to the fields definition in the bundle configuration. The sorting of the tags is done document by document according to these scores.
+
+### wikitag:sync-doc
+Synchronize the wikiTag Bundle documents with the host bundle. This synchronization is made according to the fields defined in the bundle configuration.
+