View Issue Details

IDProjectCategoryView StatusLast Update
0008341mantisbtotherpublic2007-10-04 01:38
Reporterboel Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Fixed in Version1.1.0rc1 
Summary0008341: Xwiki integration
Description

Initial integration with XWiki.
This is a fairly quick and basic start to integrating Mantis with XWiki

Steps To Reproduce

config_inc.php changes are:

   # Wiki Integration Enabled?
    $g_wiki_enable = ON;

    # Wiki Engine
    $g_wiki_engine = 'xwiki';

    # Wiki namespace to be used as root for ALL_PROJECT page relating to this mantis installation. Projects will be using the project name as space name in xwiki.
    $g_wiki_root_namespace = 'mantis';

    # URL under which the wiki engine is hosted. 
    $g_wiki_engine_url = 'http://localhost:8080/xwiki/bin/view/';
Tagspatch
Attached Files
wiki_xwiki_api.php (2,116 bytes)   
<?php
	# Mantis - a php based bugtracking system
	# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
	# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
	# This program is distributed under the terms and conditions of the GPL
	# See the README and LICENSE files for details
 
	# --------------------------------------------------------
	# $Id: wiki_xwiki_api.php $
	# --------------------------------------------------------

	# ----------------------
	# Gets the URL for the page with the specified page id.  This function is used
	# internally by this API.
	function wiki_xwiki_get_url_for_page_id( $p_page_id ) {
		$t_root_url = config_get_global( 'wiki_engine_url' );
		return $t_root_url . $p_page_id ;
	}
 
	# ----------------------
	# Gets the page id for the specified issue.  The page id can then be converted
	# to a URL using wiki_xwiki_get_url_for_page_id().
	function wiki_xwiki_get_page_id_for_issue( $p_issue_id ) {
		 
		$t_project_id = project_get_name (bug_get_field( $p_issue_id, 'project_id' ));
		$c_issue_id = db_prepare_int( $p_issue_id );
		return $c_issue_id;
 		return $t_project_id.'/'.$c_issue_id;
	}
 
 	# ----------------------
	# Gets the page url for the specified issue id.
	function wiki_xwiki_get_url_for_issue( $p_issue_id ) {
		return wiki_xwiki_get_url_for_page_id( wiki_xwiki_get_page_id_for_issue( $p_issue_id ) );
	}
 
	# ----------------------
	# Gets the page id for the specified project.  The project id can be ALL_PROJECTS
	# The page id can then be converted to URL using wiki_xwiki_get_url_for_page_id().
	function wiki_xwiki_get_page_id_for_project( $p_project_id ) {
		if ( $p_project_id == ALL_PROJECTS ) {
			return config_get( 'wiki_root_namespace' );
		} else {
			$t_project_name = project_get_name( $p_project_id );
			return $t_project_name;
		}
	}
 
 	# ----------------------
	# Get URL for the specified project id.  The project is can be ALL_PROJECTS.
	function wiki_xwiki_get_url_for_project( $p_project_id ) {
		return wiki_xwiki_get_url_for_page_id( wiki_xwiki_get_page_id_for_project( $p_project_id ) );
	}
?>
wiki_xwiki_api.php (2,116 bytes)   

Activities

boel

boel

2007-09-07 07:32

reporter   ~0015592

Tested on mantis 1.1.0a4 and xwiki 1.1RC1.

vboctor

vboctor

2007-09-07 08:01

manager   ~0015594

Thanks for your contribution. This will be included in 1.1.0rc1.