Action(edit, Edit this section)

TableOfContents(2) For more information on developing and customizing MoinMoin, check MoinDev.

How to implement interactive session

I am working on our intranet Wiki, and would like to warn users when they remove 'admin' privilege from a page (particularly for those users who inadvertently remove 'admin' from their own homepages). I have found the place in the class PageEditor, saveText method where I can determine that the old_acl differs from the new_acl, and that the old_acl had 'admin' privilege and the new_acl does not. I can then raise an appropriate exception, which caught by wikiaction.do_savepage method. What I now need is a means of presenting the user with a dialog that asks

Do you really want to remove 'admin' privilege? [Yes][No]

and returns his answer. In the case of No, I would like to replace the new_acl with the old_acl. Any suggestions? Is there a type of dialog form that I could use? - -- JohnSimonson DateTime(2005-04-19T13:21:15Z)

I don't think you really want to annoy people with "do you really" questions. Try to find another solution that does not require this kind of questions. Also, moin is not well suited to this interactive answer, question, answer, question style.

In this case I think you need some kind of automatic admin rights for user home pages and sub pages. This can be achieved with a simple security policy class. One example is here: NickWelch/RelativeGroups on the bottom of the page. -- NirSoffer DateTime(2005-04-23T22:34:03Z)

}}}

Import text into MoinMoin 1.3

I want to import external text into some page automatically, without editing the page.

Solution

Try ScriptMarket/AppendTextScript. For more information on storage format read ["MoinDev/Storage"]. For example code check PageEditor.py.

Modifying "Make this page belong to category" format

I want that the categories line will starts with "Categories:". This will make it easier to find categories on categories pages and make the data on the page more clear.

Solution

This requires patching the code in wikiaction.py. Grep for categories and you will find the lines that handle categories. The modification should not be hard if you know Python. After you create a nice patch, probably factoring this out of the current function into a small and nice function, add a feature request for this with the patch. Generally it make sense and maybe other developers will like to use the patch.

Themes test

Is there theme test page where almost all "objects" (sidebar, dialog, messages ...) are visible?

Answer

No, but pages like SyntaxReference try to use many syntax options and thereby trigger many CSS classes.

CVS backend

I've been tasked with creating a wiki that uses CVS as a backend for managing documentation at my company. Developers want CVS to be "the one" source of truth. They also want to be able to work offline, without using a Web browser at all, in their own text editors. Meanwhile, a lot of other people in the company could really benefit from using the wiki interface. Is there any way I can add this functionality to MoinMoin, or do I need to use an existing project like Pyle, which doesn't seem quite as mature?

Thanks for the response. Yes, an infrastructure for adding new backends would be helpful. Committing moin's data dir to a cvs repository won't be sufficient because it doesn't help with people committing to CVS directly, especially when there are conflicts. As much as I hate it, unless Pyle can meet my needs, I may be on my own.


CategoryFeatureRequest

Solution

CVS is not the answer, it is the question. ;) And there is no easy way currently to let moin use CVS as backend without a big hack of the code (we don't recommend that). We plan to make some backend module in 2.0, then maybe adding such stuff will be easier (but we won't implement a CVS backend ourselves).

What you should be able to do right now is to just commit moin's data dir to a cvs repository (e.g. by some external cron script). Not nice, but should work.


CategoryFeatureRequest

svk might help

One idea is to add support for svk, http://svk.elixus.org/ to moinmoin. svk builds on svn, subversion, the successor system for cvs. With subversion, one could, for example, store different versions of pages in the source control system, instead of having one file for each version. svk adds the ability to synchronize between subversion repositories. One could, for example, make a copy of the repository on a laptop, make changes offline, and then, later, merge those changes automatically into the online wiki. Keeping two different wikis synchronized could also be done by svk.

As mentioned above, it should be possible to commit moinmoin data to a svn repository.

SavePage hook

Would it be possible to have a hook in PageEditor at the spot where the raw page data is actually saved (for example in _write_file())? I am writing some extensions that extend and index the link structure, so such a hook would be a great benefit for me. I have noticed that the subject has been brought up some times in this wiki, but I'd like to know whether you are going to implement it, are having doubts or other plans, or have decided against it.

Macro that extracts macro calls: how to execute those?

I have a macro that selects all ocurrences of the [[Card(...]] macro in a given page. The problem is that the selected lines containing macros do not get rendered themselves, i.e. I see the macro invocation code [[Card(...]] instead of the output it should produce when rendered. I have posted a raw draft of the code at AlvaroTejero/ActionFilter