Organizational Chart Macro
Displays an organizational chart from list, json or xwiki data. |
Type | XAR |
Category | |
Developed by | |
Active Installs | 14 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
This macro allows to display an organization chart either from data provided as a wiki list, either from data provided as json, either from the users of the wiki using a "manager" field in the user profile.
To configure the XWiki fields, visit the Macros.OrgChartSetup page.
Credits
This extensions used the orgchart javascript library released under the MIT License by Xuebin Dong
Macro Parameters
Parameter Name | Description | Possible values | Default value |
---|---|---|---|
source | list, json, xwiki | list if there is a content parameter, xwiki if not | |
content field | wiki list or json to use as data source | see examples | empty |
user | user to start the organizational chart in xwiki source mode | any user document (XWiki.ID) | If none provided the macro will look for the first user having no manager and being a manager of at least on person |
managerfield | name of the field used to store the manager of a person | any users field in the XWiki.XWiki Users class | manager |
titlefield | name of the field used to store the title of a person | any field in the XWiki.XWikiUsers class | title |
Simple Organization Chart using an unordered list
* Jef
** John
** Joe
*** Patrick
*** Marie
{{/orgchart}}
Simple Organization Chart using json
{
'name': 'Lao Lao',
'title': 'general manager',
'children': [
{ 'name': 'Bo Miao', 'title': 'department manager' },
{ 'name': 'Su Miao', 'title': 'department manager',
'children': [
{ 'name': 'Tie Hua', 'title': 'senior engineer' },
{ 'name': 'Hei Hei', 'title': 'senior engineer',
'children': [
{ 'name': 'Dan Dan', 'title': 'engineer' }
]
},
{ 'name': 'Pang Pang', 'title': 'senior engineer' }
]
},
{ 'name': 'Hong Miao', 'title': 'department manager' }
]
}
{{/orgchart}}
Organization Chart based on XWiki users
For this organization chart to work you need to create a field in the XWiki.XWikiUsers class to hold the manager of a user.
Also you need to provide the top of the organization chart to start with.
XWiki can also find automatically a user that had reporters and no manager to start the tree
The result will depend on the user profiles in your wiki.
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Release Notes
v1.0.1
- Fixed missing webjar dependency
Dependencies
Dependencies for this extension (org.xwiki.contrib:macro-orgchart 1.0.1):
- org.webjars.npm:orgchart 2.0.4