Plugin Developer Discussion

Discussion for FogBugz Plugin developers

Wiki page id & URL

Hi all,
my plugin needs to know the id of the current wiki page the user is editing. I know there is no API for this, then what I do is to parse the URL with Javascript.
It used to work well, but a customer reports that the URL of a new wiki page is like default.asp?W19 while the URL of an existing page in edit mode is default.asp?pg=pgWiki&ixWikiPage=1&command=edit.
I think that for the moment I will fix the regexp which parses the URL, but is there a better way to get the wiki page id?

Ciao
Marco
Marco Botton Send private email
Friday, December 11, 2009
 
 
Hi Marco-
Could you tell me which Wiki interfaces your plugin is implementing and at what point you need to know the ixWikiPage, and I'll tell you if there is a better way to get the ixWikiPage? Do you need to know it when you create a Wysiwyg context menu item, or at page display time?
Thanks!
Brett
Brett Kiefer Send private email
Saturday, December 12, 2009
 
 
Hi Brett,
thanks for replying.
My plugin implements a WikiBlock subclass which adds a menu item. When the user selects the item, the WikiBlock displays a dialog and automatically opens the Flash editor on top of the whole page. The HTML of the dialog contains some Javascript to parse the URL, get the wiki page id, and build the URL to invoke the editor. The wiki page id is appended to the editor URL.
If you prefer to read the actual code, just let me know and I'll send it to you by mail.

Ciao
Marco
Marco Botton Send private email
Monday, December 14, 2009
 
 
Hi Marco-
You're right, this is terribly unclear. This is part of the answer: http://fogbugz.stackexchange.com/questions/732/plug-in-api-how-to-i-get-information-about-the-container-wiki-page-in-wikiblock

. . . but for the rest (how to get this data to the Dialog) I will pass you along to Dane, our WikiBlocks expert.

Thanks!
Brett
Brett Kiefer Send private email
Monday, December 14, 2009
 
 
Hi Marco,

I worked on a lot of the WikiBlock code during my internship two summers ago, and I agree, we could definitely be doing a better job of explaining the relationships between (and functionalities of) the WikiBlock, WikiBlockPlugin, and WikiBlockManager classes. I've filed some cases against myself to make this clearer and to also do some refactoring.

To answer your question, no, currently there isn't a better way of making the ixWikiPage available to your insert dialog. You can make do with a custom WikiBlockManager if you need to pass along the ixWikiPage to a WikiBlock when it's being rendering (as per the stackexchange question Brett linked to), but not for not-yet-created WikiBlocks (i.e., when inserting a new WikiBlock). This is a bug in our API and we'll definitely be working to fix it soon.

The underlying problem is that WikiBlockManager does a bunch of magic during WysiwygInsertMenuDialogDisplay that isn't very well exposed to plugin developers.

If there's anything else we can help with though, please let us know!

Cheers,
Dane
Dane Bertram Send private email
Monday, December 14, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz