Storage and packaging of PersonalMoinMoin application, settings and documents

See also:

General

MoinMoin contains 3 parts: application, application settings and the farm. After installation, the user create some configuration, for example, one wiki. The wiki is like a document the user saved, it can be anywhere, and only MoinMoin need access to it. The Application can be anywhere the user installed it, it can be in the user home or in the machine Applications or Program Files directory.

Application

Will be packaged as bundle, exe or directory:

The MoinMoin package will bot be installed, and the startup script will simply load it from the application bundle by setting the python system path.

Since underlay and htdocs are at constant location, there is no need to configure those, although we can support custom configuration if we like.

Application settings

Farm configuration data

Here are several alternatives for storage:

OS X

Application

There are several ways to use the application.

The application might want to be started automatically on startup, its not hard to do by adding a script to the system startup directory (needs admin rights).

Application settings

Desktop application in OS X save the user preferences inside the user Library folder.

On Mac OS X, a wiki can be packaged as a bundle, and look like single document, for example RedWiki.wiki or RedWiki.moinmoin. The wiki document can be assosiated with MoinMoin and automatically run MoinMoin application on double click, activating the wiki. In this case, MoinMoin does not need to know where are the wikis located, you simply open a wiki to make it active, and close to deactivate. With this setup, one can move wikis around, MoinMoin does not care. The problem is this behavior is Mac OS X only.

Using Cocoa Defaults

Preferences managed by Cocoa defaults system are automatically saved in ~/Library/Preferencess in the file with the application signature. These files have names like: com.apple.Safari.plist and use xml format. Cocoa defaults system let you add, remove and query keys saved in those files and in other domains. Using PyObjc, we can manage all kind of settings without writing even one line of IO code.

We can save all farm configuration, including all wiki data using org.moin.MoinMoin.plist. Then on startup, load the values and create configuration classes as if we imported real farmconfig and wikiconfig mordules.

Example of plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>ActivitiesStartExpanded</key>
        <true/>
        <key>AddressBarIncludesAddBookmark</key>
        <false/>
        <key>AddressBarIncludesGoogle</key>
        <true/>
        <key>AddressBarIncludesReportBug</key>
        <false/>
        <key>AddressBarIncludesTextSizing</key>
        <true/>

Defaults are handled with: http://developer.apple.com/documentation/Cocoa/Conceptual/UserDefaults/index.html

You set a default with setObject:forKey: and get them with objectForKey:, using PyObjc.

Special files

Applications that want to manage bigger data sets, for example few separate support files, use ~/Library/Application Support/Application Name.

If we keep the current or similar configuration setup, we might save it in ~/Library/Application Support/MoinMoin.

The main difference from current code - we load all the configuration on startup from hardcoded location, there is no need for playing with Python system path.

Linux

Are there any standards for keeping user configuration files?

Winodows

Discussion

Seems that the best solution for a multiplatform setup while keeping minimal platform specific code is use a hardcoded location in the file system to save configuration, so we can use exactly the same code to load or save the configuration.

MoinMoin: PersonalMoinMoin/StorageAndPackaging (last edited 2007-10-29 19:06:09 by localhost)