Taxonomies are used to sort documents to ease searches when browsing documents online. The main idea behind that concept is to provide a multi dimensional set of paths to find a document. The best example is when you browse Yahoo news. In many cases, you can get your content by using different category paths. Therefore, after creating a document somewhere in the repository, it is possible to categorize it by adding several taxonomy references. By browsing the taxonomy tree, it will be possible to find the referencing article and display them as if they were children of the taxonomy nodes. As you can imagine, taxonomies are stored in the JCR itself and we are using the JCR Reference functionality to provide that advanced ECM feature.

Managing the tree of taxonomies is very simple, you can copy/cut nodes and paste them. Of course, you can add and remove taxonomies from the tree. Once a taxonomy has been added, any user who has access to the "Manage Categories" icon from his/her view can then browse the taxonomy tree and refer one of its nodes to the created documents.


h1. Fields
*Object type*: _org.exoplatform.services.cms.taxonomy.impl.TaxonomyTreeDefaultUserPermission_
|| *Field name* || *Collection type* ||*Description* ||
| *permissions* | {{java.util.ArrayList<TaxonomyTreeDefaultUserPermission$Permission>}} | List of default user permission to access the taxonomy tree |

*Object type*: _org.exoplatform.services.cms.taxonomy.impl.TaxonomyTreeDefaultUserPermission$Permission_


|| *Field name*|| *Type* || *Default value*|| *Description* ||
| *identity* | {{String}} |{{ {{{*:/platform/administrators}}} }}| user name or user group. |
| *read* | {{Boolean}} |{{true}}| permission to read  the taxonomy tree. |
| *addNode* | {{Boolean}} | {{true}}| permission to add a node in the taxonomy tree. |
| *setProperty* | {{Boolean}} |{{true}}| permission to set properties for a node in the taxonomy tree . |
| *remove* | {{Boolean }} | {{true}}| permission to remove a node from the taxonomy tree. |

*Target Component*: {{org.exoplatform.services.cms.taxonomy.TaxonomyService}}

*Name*: {{predefinedTaxonomyPlugin}}

*Set-method*: {{addTaxonomyPlugin}}

*Type*: _org.exoplatform.services.cms.taxonomy.impl.TaxonomyPlugin_

|| *value param*|| *Type* || *Default value* || *Description*||
| *autoCreateInNewRepository* | {{Boolean}} |{{true}}| enable/ Disable the creation of the taxonomies in new created repository. |
| *repository* | {{String}} |{{repository}}| name of the repository where taxonomies are created. |
| *workspace* | {{String}} |{{dms-system}}| name of the workspace where taxonomies are created. |
| *treeName* | {{String}} | {{system}}|name of the taxonomy tree to be created. |

|| *Object param*|| *Type* || *Default value* || *Description*||
| *permission.configuration* | {{String}}|{{org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig}} | access permission for the whole taxonomy tree. |
| *predefined.actions* | {{string}}| {{org.exoplatform.services.cms.actions.impl.ActionConfig}} | predefined actions for the taxonomy tree root node. |
| *taxonomy.configuration* | {{String}}| {{org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig}} | access permissions for each taxonomy in tree. |

*Object type*: _org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig_
||*Name* || *Type*|| *Description*  ||
| *taxonomies* | {{java.util.ArrayList<TaxonomyConfig$Taxonomy>}} | list of taxonomy to be configured permission. |

*Object type*: _org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig$Taxonomy_
||*Name* || *Type*|| *Default value*|| *Description*  ||
| *name* | {{String}} | {{name}}| name of the taxonomy. |
| *path* | {{String}} | {{cms}}| path to the taxonomy in taxonomy tree. |
| *permissions* |{{Arraylist}}| {{java.util.ArrayList<TaxonomyTreeDefaultUserPermission$Permission>}} | list of permissions for user or group to access the taxonomy. |

*Object type*: _org.exoplatform.services.cms.actions.impl.ActionConfig_
||*Name* || *Type*|| *Default value*|| *Description*  ||
| *actions* || {{Arraylist}}|{{java.util.ArrayList<ActionConfig$TaxonomyAction>}} | list of actions which are created for the taxonomy tree root node. |

*Object type*: _org.exoplatform.services.cms.actions.impl.ActionConfig$TaxonomyAction_
|| *Field name* || *Type* ||*Default value*||  *Description* ||
| *type* | {{String}} |{{exo:taxonomyAction}}| type of the action. |
| *name* | {{String}} |{{taxonomyAction}}|  name of the action. |
| *description* | {{String}} | {{N/A}}|  description of the action. |
| *homePath* | {{String}} | {{dms-system:/exo:ecm/exo:taxonomyTrees/storage/System}}| location of node where the action node is stored. |
| *targetWspace* | {{String}} |{{N/A}}|  when a new node is created in the node whose path is defined in *homePath* field, it will be moved to a new location automatically. The target workspace is specified in this field. |
| *targetPath* | {{String}} |{{collaboration}}|  when a new node is created in the node whose path is defined in *homePath* field, it will be moved to a new location automatically. The target path is specified in this field. |
| *lifecyclePhase* |{{Arraylist}}|  {{java.util.ArrayList<String>}} | the life cycle phases, in which the action is activated. |
| *roles* | {{String}} | {{{*:/platform/administrators}}}| the users or groups only with whom the action is activated. |
| *mixins* |{{Arraylist}}|  {{java.util.ArrayList<ActionConfig$Mixin>}} | list of node types that are affected by this action. |

*Object type*: _org.exoplatform.services.cms.actions.impl.ActionConfig$Mixin_
|| *Field name* || *Type* || *Default value*||  *Description* ||
| *name* | {{String}} |{{mix:affectedNodeTypes}}|  mixin node type name that will be added, whose responsibility is to store the affected node types. |
| *properties* || {{String}} | {{exo:affectedNodeTypeNames=exo:article,exo:podcast,exo:sample,kfx:document,nt:file,rma:filePlan}}| the name of the properties that store all the node types affected by the action. |



h1. Sample Configuration

{code:language=xml|indent=2}

<component>
	<key>org.exoplatform.services.cms.taxonomy.TaxonomyService</key>
	<type>org.exoplatform.services.cms.taxonomy.impl.TaxonomyServiceImpl</type>
	<init-params>
		<object-param>
			<name>defaultPermission.configuration</name>
			<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyTreeDefaultUserPermission">
				<field name="permissions">
					<collection type="java.util.ArrayList">
						<value>
							<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyTreeDefaultUserPermission$Permission">
								<field name="identity"><string>*:/platform/administrators</string></field>
								<field name="read"><string>true</string></field>
								<field name="addNode"><string>true</string></field>
								<field name="setProperty"><string>true</string></field>
								<field name="remove"><string>true</string></field>
							</object>
						</value>
					</collection>
				</field>
			</object>
		</object-param>
	</init-params>
	
	<external-component-plugins>
		<target-component>org.exoplatform.services.cms.taxonomy.TaxonomyService</target-component>
		<component-plugin>
			<name>predefinedTaxonomyPlugin</name>
			<set-method>addTaxonomyPlugin</set-method>
			<type>org.exoplatform.services.cms.taxonomy.impl.TaxonomyPlugin</type>
			<init-params>
				<value-param>
					<name>autoCreateInNewRepository</name>
					<value>true</value>
				</value-param>
				<value-param>
					<name>repository</name>
					<value>repository</value>
				</value-param>
				<value-param>
					<name>workspace</name>
					<value>dms-system</value>
				</value-param>
				<value-param>
					<name>treeName</name>
					<value>System</value>
				</value-param>
				<object-param>
					<name>permission.configuration</name>
					<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig">
						<field name="taxonomies">
							<collection type="java.util.ArrayList">
								<value>
									<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig$Taxonomy">
										<field name="permissions">
											<collection type="java.util.ArrayList">
												<value>
													<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig$Permission">
														<field name="identity"><string>*:/platform/users</string></field>
														<field name="read"><string>true</string></field>
														<field name="addNode"><string>true</string></field>
														<field name="setProperty"><string>true</string></field>
														<field name="remove"><string>false</string></field>
													</object>
												</value>
											</collection>
										</field>
									</object>
								</value>
							</collection>
						</field>
					</object>
				</object-param>
				<object-param>
					<name>predefined.actions</name>
					<description>description</description>
					<object type="org.exoplatform.services.cms.actions.impl.ActionConfig">
						<field  name="actions">
							<collection type="java.util.ArrayList">
								<value>
									<object type="org.exoplatform.services.cms.actions.impl.ActionConfig$TaxonomyAction">
										<field  name="type"><string>exo:taxonomyAction</string></field>
										<field  name="name"><string>taxonomyAction</string></field>
										<field  name="description"><string></string></field>
										<field  name="homePath"><string>dms-system:/exo:ecm/exo:taxonomyTrees/storage/System</string></field>
										<field  name="targetWspace"><string>collaboration</string></field>
										<field  name="targetPath"><string>/Documents</string></field>
										<field  name="lifecyclePhase">
											<collection type="java.util.ArrayList">
												<value><string>node_added</string></value>
											</collection>
										</field>
										<field  name="roles"><string>*:/platform/administrators</string></field>
										<field  name="mixins">
											<collection type="java.util.ArrayList">
												<value>
													<object type="org.exoplatform.services.cms.actions.impl.ActionConfig$Mixin">
														<field  name="name"><string>mix:affectedNodeTypes</string></field>
														<field  name="properties">
															<string>exo:affectedNodeTypeNames=exo:article,exo:podcast,exo:sample,kfx:document,nt:file,rma:filePlan</string>
														</field>
													</object>
												</value>
											</collection>
										</field>
									</object>
								</value>
							</collection>
						</field>
					</object>
				</object-param>
				<object-param>
					<name>taxonomy.configuration</name>
					<description>configuration predefined taxonomies to inject in jcr</description>
					<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig">
						<field name="taxonomies">
							<collection type="java.util.ArrayList">
								<!-- cms taxonomy -->
								<value>
									<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig$Taxonomy">
										<field  name="name"><string>cmsTaxonomy</string></field>
										<field  name="path"><string>/cms</string></field>
										<field name="permissions">
											<collection type="java.util.ArrayList">
												<value>
													<object type="org.exoplatform.services.cms.taxonomy.impl.TaxonomyConfig$Permission">
														<field name="identity"><string>*:/platform/users</string></field>
														<field name="read"><string>true</string></field>
														<field name="addNode"><string>true</string></field>
														<field name="setProperty"><string>true</string></field>
														<field name="remove"><string>false</string></field>
													</object>
												</value>
											</collection>
										</field>
									</object>
								</value>
							
							</collection>
						</field>
					</object>
				</object-param>
			</init-params>
		</component-plugin>
	</external-component-plugins>

</component>


{code}
