Mantis and Dokuwiki Integration - admin login for dokuwiki

Get help from other users here.

Moderators: Developer, Contributor

dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Mantis and Dokuwiki Integration - admin login for dokuwiki

Post by dlst »

Hello,

I've just recently integrated Mantis 1.1.0a2 with Dokuwiki. Works very nicely, but I have a few questions:

- After integration, the login on dokuwiki no longer works (it's necessary for a user to login to Mantis first, then click on the "Wiki" link). Is this by design?

- After integration, it is no longer possible to log into the DokuWiki admin. (Even logging into Mantis with developer, manager, or administrator levels (all "8" in acl.auth.php), the admin link in DokuWiki isn't there). So, how does one perform admin functions in DokuWiki?

- Under "Tips" in http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki the documentation talks about using namespaces and creating _template.txt files in the namespace folder that correspond to a project name but it then goes on to say that namespaces would correspond to categories. So, which is it? Projects or categories (as projects in mantis have categories). Can anyone elaborate on this?

(I would be happy to update the Wiki entry on this to clarify it a bit, once I'm clear on what's going on)

- This may be made clear once the questions above are answered, but I'd like to know if the following usage pattern makes sense/is recomended, etc.

In my company's Mantis we track and maintain several projects. Each project has its own set of viewers, developers (with overlap of course), etc. What I want is to have separate sections in the DokuWiki that correspond to each project. Hopefully this is what the "Tips" section above is referring to.
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

Try the wiki plugin (follow the link in my signature). Some bugs have been fixed (admin login).
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Re: Mantis and Dokuwiki Integration - admin login for dokuwi

Post by deboutv »

dlst wrote: - Under "Tips" in http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki the documentation talks about using namespaces and creating _template.txt files in the namespace folder that correspond to a project name but it then goes on to say that namespaces would correspond to categories. So, which is it? Projects or categories (as projects in mantis have categories). Can anyone elaborate on this?
For template you need to create a file named "_template.txt" (without the ") in the namespace directory (/var/www/mantis/dokuwiki/data/pages/mantis/ by example).
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Re: Mantis and Dokuwiki Integration - admin login for dokuwi

Post by dlst »

deboutv wrote:
dlst wrote: - Under "Tips" in http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki the documentation talks about using namespaces and creating _template.txt files in the namespace folder that correspond to a project name but it then goes on to say that namespaces would correspond to categories. So, which is it? Projects or categories (as projects in mantis have categories). Can anyone elaborate on this?
For template you need to create a file named "_template.txt" (without the ") in the namespace directory (/var/www/mantis/dokuwiki/data/pages/mantis/ by example).
Ah, thanks for pointing out the directory location. What should the _template.txt file look like? Is there a sample format available anywhere I can take a look at?
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Post by dlst »

deboutv wrote:Try the wiki plugin (follow the link in my signature). Some bugs have been fixed (admin login).
I definitely will try this. Forgive me if it's obvious, but is this the same as what is in the dokuwiki in Mantis?: http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki

Thanks!
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Post by dlst »

deboutv wrote:Try the wiki plugin (follow the link in my signature). Some bugs have been fixed (admin login).
I've installed your plugin, and I wanted to point out one mistake in the docs. In http://deboutv.free.fr/mantis/plugin.php?plugin=Wiki it says to "Remove the define statement in the MANTIS_ROOT/dokuwiki/conf/local.php file."

After doing this, it's necessary to update /mantis/dokuwiki/lib/tpl/default/main.php line 18 from

Code: Select all

require_once( MANTIS_ROOT . 'core.php' );
to

Code: Select all

require_once( dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . DIRECTORY_SEPARATOR . 'core.php' );
Other than that installation went smoothly, and now I can access dokuwiki in /mantis/dokuwiki/

However, I get an error when I go to my /mantis/plugins_page.php and click on the "Wiki" link:

Code: Select all

The webserver does not have write access on the dokuwiki directory
It's odd, as accessing dokuwiki directly works fine (so the permissions are correct according to dokuwiki install). I tried changing /mantis/dokuwiki to 777 but I still get the error above. Odd.

Any help would be greatly appreciated.

EDIT: I figured out the problem, after looking at /mantis/plugins/wiki/index.php and I saw that it's checking if

/mantis/dokuwiki/conf/local.php

and

/mantis/dokuwiki/conf/users.auth.php

are writeable. If they are not, it displays the write error above (which I updated to be a little more helpful, let me know if I should submit that back to you). So I updated the permissions and now it's looking ok.
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Post by dlst »

I want to note a little minor bug (possibly only in this installation? not sure):

- Go to /mantis/dokuwiki/doku.php?id=start&do=admin&page=config (that admin page for the dokuwiki install from your plugin)
- In the "superuser" field the default value after editing is

Code: Select all

'{myusername}';define('MANTIS_ROOT','/{mypath}/mantis/')
Obviously the {myusername} part should just be that, without quotes and of course without the define part. I'm not sure where that value is coming from, but it's easy enough to fix: just change the field to the correct superuser value (the admin part set in the plugins page in mantis after the plugin install).

But if you're not careful to fix this value before saving the configuration, then you will lock yourself out of your dokuwiki, forcing a re-upload of /conf/local.php

I hope this saves someone else some time.

----

EDIT: Another bug is in the newest version of /dokuwiki/lib/plugins/mantis/syntax.php. The link rendering function results in a link that looks like:

/mantis/dokuwiki/view.php?id=374

Which is wrong. It should be /mantis/view.php?id=374

So I changed line 120 from

Code: Select all

$renderer->externallink( config_get( 'path' ) . 'view.php?id=' . $data[0], $data[0] );
to

Code: Select all

$renderer->externallink( substr( config_get( 'path' ), 0, -9 ) . 'view.php?id=' . $data[0], $data[0] );
It's sort of an ugly hack, but at least it fixes the problem pretty reliably. Again, hopefully this helps someone else.[/code]
Last edited by dlst on 27 Mar 2007, 05:40, edited 1 time in total.
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Post by dlst »

Ok, now that everything is completely installed and working, I have an incredibly stupid question:

How exactly does the plugin integrate with dokuwiki? I have a working Mantis install, and a working dokuwiki install that was part of the plugin in /mantis/dokuwiki/, but how do I now actually use it?

The http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki outlines links from each tickets to the dokuwiki install, but this plugin doesn't seem to have them (unless I'm missing something).

----

I've answered this one myself: I didn't replace the /mantis/core/wiki_plugin_dokuwiki_api.php file with the one from this release. Now that I have done so, everything works fine.
Last edited by dlst on 27 Mar 2007, 06:10, edited 1 time in total.
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Post by dlst »

For the purposes of documentation, I have to say that the facility to have dokuwiki replace ~~Mantis:1234~~ with a link to the corresponding link number in Vincent Debout's version has the added facility to automatically display sections of the ticket data in DokuWiki.

Say, for example, you want to display the 'steps_to_reproduce' field from the ticket number '1234'. You would put this into the edit window in DokuWiki:

~~Mantis:1234:steps_to_reproduce~~

And this will display the contents of that field. VERY USEFUL! Of course the "normal" way of making the link works just fine.

The list of supported field names is in /dokuwiki/lib/plugins/mantis/syntax.php in lines 95 - 117 (after "case 'description':"), which is:

description
steps_to_reproduce
additional_information
summary
category
os
os_build
platform
version
fixed_in_version
target_version
build
date_submitted
last_updated

This is just a post to document this feature that I couldn't find anywhere else. Hope it helps.
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Re: Mantis and Dokuwiki Integration - admin login for dokuwi

Post by dlst »

No, really, I'm done now.

The only question I have left is the one below:
dlst wrote:
deboutv wrote:
dlst wrote: - Under "Tips" in http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki the documentation talks about using namespaces and creating _template.txt files in the namespace folder that correspond to a project name but it then goes on to say that namespaces would correspond to categories. So, which is it? Projects or categories (as projects in mantis have categories). Can anyone elaborate on this?
For template you need to create a file named "_template.txt" (without the ") in the namespace directory (/var/www/mantis/dokuwiki/data/pages/mantis/ by example).
Ah, thanks for pointing out the directory location. What should the _template.txt file look like? Is there a sample format available anywhere I can take a look at?
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

dlst wrote:For the purposes of documentation, I have to say that the facility to have dokuwiki replace ~~Mantis:1234~~ with a link to the corresponding link number in Vincent Debout's version has the added facility to automatically display sections of the ticket data in DokuWiki.

Say, for example, you want to display the 'steps_to_reproduce' field from the ticket number '1234'. You would put this into the edit window in DokuWiki:

~~Mantis:1234:steps_to_reproduce~~

And this will display the contents of that field. VERY USEFUL! Of course the "normal" way of making the link works just fine.

The list of supported field names is in /dokuwiki/lib/plugins/mantis/syntax.php in lines 95 - 117 (after "case 'description':"), which is:

description
steps_to_reproduce
additional_information
summary
category
os
os_build
platform
version
fixed_in_version
target_version
build
date_submitted
last_updated

This is just a post to document this feature that I couldn't find anywhere else. Hope it helps.
I will document it in the website ;)
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Re: Mantis and Dokuwiki Integration - admin login for dokuwi

Post by deboutv »

dlst wrote:No, really, I'm done now.

The only question I have left is the one below:
dlst wrote:
deboutv wrote: For template you need to create a file named "_template.txt" (without the ") in the namespace directory (/var/www/mantis/dokuwiki/data/pages/mantis/ by example).
Ah, thanks for pointing out the directory location. What should the _template.txt file look like? Is there a sample format available anywhere I can take a look at?
There is no special format. Keep in mind that when a user creates a new page, the textarea will be filled by the content of _template.txt file (if it exists).

So you can write in the _template.txt file (by example):

# replace all #* by the corresponding value and remove this line
~~Mantis:#id:summary~~

== Description ==
#Describe here the bug

== Workaroud ==
#Describe here the workaround
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

dlst wrote:
deboutv wrote:Try the wiki plugin (follow the link in my signature). Some bugs have been fixed (admin login).
I definitely will try this. Forgive me if it's obvious, but is this the same as what is in the dokuwiki in Mantis?: http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki

Thanks!
Not exactly the same, the namespace management is changed. In the Mantis proposal, the project are identified by their name. In my version, the project are identified by their id (it prevents project name change and prevents conflict when the project name contains special characters). I have updated the default template to mask this difference (in the modified template, the project id is automatically converted to the name).
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

I have reported the bug in the dedicated bugtracker.

Thanks for your report.
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
dlst
Posts: 13
Joined: 26 Mar 2007, 03:38

Post by dlst »

deboutv wrote:
dlst wrote:
deboutv wrote:Try the wiki plugin (follow the link in my signature). Some bugs have been fixed (admin login).
I definitely will try this. Forgive me if it's obvious, but is this the same as what is in the dokuwiki in Mantis?: http://www.mantisbt.org/wiki/doku.php/m ... h_dokuwiki

Thanks!
Not exactly the same, the namespace management is changed. In the Mantis proposal, the project are identified by their name. In my version, the project are identified by their id (it prevents project name change and prevents conflict when the project name contains special characters). I have updated the default template to mask this difference (in the modified template, the project id is automatically converted to the name).
I understand your reasoning for having the Wiki display ProjectID and TicketID instead of the project name and ticket name, but what if I would prefer to do it the other way? I understand that changing the project name or ticket name would cause problems, but I (personally) think it's worth the price to make the Wiki easier to read.

I would like the link to be:

/mantis/dokuwiki/doku.php?id=SITENAME:PROJECTNAME(ID):issue:TICKETNAME(ID)

How would I set it to use Project names and Ticket names instead of id's?
Post Reply