Space Hierarchy & Breadcrumbs

Space hierarchy and Breadcrumbs plugin for Confuence can be used for following purpose:

    • Creating Space hierarchy (Parent-Child relationship, grouping similar spaces)
    • Breadcrumbs at top pages which provides easy navigation between spaces in hierarchy

Creating Space Hierarchy

Space hierarchy can be created by setting parent child relation between spaces. As soon as plugin is installed 'Hivestone' section is created under Space Admin section. Hivestone section provides 'Set Parent space' capability. After installing plugin Space Admin section will create Hivestone section as shown in image:

Hivestone Space Hierarchy

Creating sample space hierarchy - If we have a space named 'Continents' with spacekey 'continents' and there is another space named 'North America' with spacekey 'northamerica'. Similarly space having name 'USA' with spacekey 'usa' and space having name 'Canada' with spacekey 'canada'. If Space Admin->Hivestone->Set parent space of 'North America' is set to 'continents' and that of 'USA' and 'Canada' is set to 'northamerica' following hierarchy will be created (Continents and North America part)

Above hierarchy will be displayed at any place where 'Space Hierarchy' macro is used and spacekey 'continents' is provided as parameter to macro. Home page of space 'Continents' is good place to insert 'Space Hierarchy' macro for above case. Following similar steps we can create multilevel hierarchy structure. Example multilevel hierarchy could be like this:

Rest apis are also provided to update the Patent space setting and get the children space of provided space. Apis included in plugin are

    • <Base URL>/rest/hcms_space_hier/1.0/space_settings/parent-fetch/space-key/{space-key} (GET)
    • <Base URL>/rest/hcms_space_hier/1.0/space_settings/children-fetch/space-key/{space-key} (GET)
    • <Base URL>/rest/hcms_space_hier/1.0/space_settings/parent-save (POST with data space-key and parent)

Breadcrumbs at top of pages

Breadcrumbs at top of pages could be displayed using 'hivestonebreadcrumb' macro which comes along with Space Hierarchy & Breadcrumbs plugin. To apply this macro globally General Configurations-> Look and Feel section could be used. {hivestonebreadcrumb} could be provide in header section.

In case some Theme is applied globally then Configure Theme link could be used to insert the macro in header of each page.

Breadcrumbs will appear at top of each page as shown in image

Best part of plugin is that it does not impact the performance of Confluence server instance which maybe the case with other available plugins.

FAQ

Q. I want to see the each and every hierarchy of my Confluence site. How to do this?

Ans. It can be done using following steps-

    • Set Parent Space of every root space of every hierarchy as 'dashboard'. In above explained example set parent space of 'Continents' and 'Hivestone' as 'dashboard'.
    • Now use 'Space Hierarchy' macro and provide 'dashboard' as parameter to macro.
    • Wherever you will use above macro with dashboard as parameter whole hierarchy will start appearing as macro output.

Q. I have got list of spaces with parent and child relationship. Can I insert this information in Space Hierarchy & Breadcrumbs plugin programatically without going through each space settings?

Ans. Yes, Space Hierarchy & Breadcrumbs macro provides open rest API to get and set parent child relationship. We have provided 3 api's to get and set relationship information.

  • <Base URL>/rest/hcms_space_hier/1.0/space_settings/parent-fetch/space-key/{space-key} (GET)
  • <Base URL>/rest/hcms_space_hier/1.0/space_settings/children-fetch/space-key/{space-key} (GET)
  • <Base URL>/rest/hcms_space_hier/1.0/space_settings/parent-save (POST with data space-key and parent)

Perl, python or java can be used to feed the information in system using above apis.

Sample Perl script to do above operations would look like this:

use RPC::XML;
use RPC::XML::Client;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use HTTP::Cookies;
use LWP::Simple;
use Data::Dumper;
$ua =LWP::UserAgent->new;
my $cookie = new HTTP::Cookies( ignore_discard => 1 );
$ua->cookie_jar( $cookie );
my $URLPrefix="<Base URL>/rest/hcms_space_hier/1.0/space_settings";
#Provide user name, password and spacekey here or through arguments as $ARGV[0] or some file
our $username = "";
our $password = "";
my $spacekey = "";
my $parent_spacekey = "";
#Get parent space of given space
my $Get_from_url = "$URLPrefix/parent-fetch/space-key/$spacekey";
my $request=HTTP::Request->new (GET => "$Get_from_url");
$request->authorization_basic("$username","$password");
my $response = $ua->request($request);
print Dumper($response);
#Get child space of given space
$Get_from_url = "$URLPrefix/children-fetch/space-key/$spacekey";
my $request=HTTP::Request->new (GET => "$Get_from_url");
$request->authorization_basic("$username","$password");
$response = $ua->request($request);
print Dumper($response);
#Set parent space of given space
my $POSTFROMURL="$URLPrefix/parent-save";
my $post_data="space-key=$spacekey&parent=$parent_spacekey";
my $request=HTTP::Request->new (POST => "$POSTFROMURL");
$request->authorization_basic("$username","$password");
$request->header("X-Atlassian-Token" => "no-check"); #This may be required if there is some configuration issue
$request->content($post_data);
my $response = $ua->request($request);
print Dumper($response);

Credits

Our customers play and important role in making our solution better. Thanks to everyone who provided feedback, suggestions and reported some issues.

Atlassian Marketplace Link of this plugin - Space Hierarchy & Breadcrumbs