Customizing Bambi-Editor
Bambi-Editor functionality is driven by
bambi.properties configuration file.
This file lives outside of bambi-editor-XXX.jar in desktop
edition, and is part of bambi-config-XXX.jar in Web Start
edition. In a typical desktop deployment, user is free to modify
this file to adjust Bambi default behavior.
All of the available configuration parameters are defined in a
special
interface
which contains additional documentation and often explains
how each parameter should be used. When you see a comment
of this format:
# :: CONFIG_DUMMY_KEY
key=value
the all caps commented reference is the name of the
constant in the interface which defines the actual
property name (key). In the above example CONFIG_DUMMY_KEY could
be defined inside ConfigParameters.java as follows:
/**
* Some dummy key that holds a meaningless value
*/
public static final String CONFIG_DUMMY_KEY = "key";
Desktop Edition Configuration
Here is defaut bambi.properties which is used to deploy
desktop edition:
# bambi editor settings
# :: WELCOME_RESOURCE_PATH
welcomeResourcePath = /welcome.html
# :: RULER_TOGGLE_ONOFF_VISIBLE
isRulerToggleVisible = true
# :: RULER_VISIBLE
isRulerVisible = true
# :: LOOK_AND_FEEL
lookAndFeel = com.jgoodies.looks.plastic.Plastic3DLookAndFeel
# :: BUSINESS_NAME_LONG
businessNameLong = BambiEditor
# :: BUSINESS_NAME_SHORT
businessNameShort = bambieditor.org
# :: HELP_PAGE_URL | useful in JWS mode to show your custom help
helpPageUrl=http://bambieditor.sourceforge.net
# :: RADIOGROUP_OUTPUTTYPE_LABEL
#picOutputTypeLabel = Selector
# :: PIC_SELECTOR_VISIBLE
isSelectorVisible = true
# :: HOST | not really using in Desktop Edition
#host = http://localhost/
# :: AUTH_REQUIRED | following AUTH_ not needed since this is false
isAuthenticationRequired = false
# :: AUTH_PROMPT | custom login prompt
#authenticationPrompt = Please Login
# :: AUTH_LOGINID_PLUGIN
#authLoginIdSecurity = org.zimowski.bambi.editor.plugins.ClearTextProxy
# :: AUTH_PASS_PLUGIN
#authPasswordSecurity = org.zimowski.bambi.editor.plugins.MD5Digest
# :: IMAGE_EXPORT_PLUGIN
exporter = org.zimowski.bambi.editor.plugins.FilesystemImageExporter
# :: IMAGE_EXPORT_PLUGIN.tooltip - see AbstractImageExporter.CONFIG_TOOTLIP
exporter.tooltip.eng = Save Image to File
# :: AUTOLOAD_IMAGE_FILEPATH
#autoloadImageFilePath=/some/file/you/want/loaded/on/startup
# :: NUMBER_OF_PIC_OUTPUTS
numberOfPicOutputOptions = 3
# :: PIC_OUTPUT_FORMAT
pic1OutputFormat = jpg
# :: PIC_RADIO_LABEL
pic1RadioLabel = Rectangular
# :: PIC_TARGET_SHAPE
pic1Shape = 1
# :: PIC_RATIO_PRESERVED
#pic1PreserveRatio = false
# :: PIC_TARGET_WIDTH | valid if PIC_RATIO_PRESERVED is true
#pic1TargetWidth =
# :: PIC_TARGET_HEIGHT | valid if PIC_RATIO_PRESERVED is true
#pic1TargetHeight =
#
pic2OutputFormat = png
pic2RadioLabel = Oval
pic2Shape = 2
#
pic3OutputFormat = jpg
pic3RadioLabel = Full Size
pic3Shape = 3
Notice for convenience we referenced each property name
with a corresponding constant from ConfigParameters.java which
further documents each property. As you can see, Bambi-Editor
can be configured in quite a few ways. For example, you
can completely control number of image selectors (currently
maximum of 4), their shape and output format. You can control
the upload strategy by defining
export plugin
and you can even configure Bambi to choose what type of
authentication (if any) use for login id, password, either,
both, or none.
Web Start Edition Configuration
For comparison, here is configuration used for our website
JWS deployment. We are omitting extended commentary this time:
# bambi editor settings
#
welcomeResourcePath = /welcome.html
isRulerToggleVisible = true
isRulerVisible = true
lookAndFeel = com.jgoodies.looks.plastic.Plastic3DLookAndFeel
numberOfPicOutputOptions = 4
businessNameLong = BambiEditor
#businessNameShort = bambieditor.org
isSelectorVisible = true
host = http://@url@/@upload.dir@
helpPageUrl = config.php
# since web demo runs md5 on passwords we need hash accordingly
isAuthenticationRequired = true
authPasswordSecurity = org.zimowski.bambi.editor.plugins.MD5Digest
exporter = org.zimowski.bambi.editor.plugins.MultipartFormPostImageUploader
exporter.tooltip.eng = Upload to Demo Site
exporter.1.processingScript = pic_upload.php?p=1
exporter.2.processingScript = pic_upload.php?p=2
exporter.3.processingScript = pic_upload.php?p=3
exporter.4.processingScript = pic_upload.php?p=4
pic1OutputFormat = jpg
pic1RadioLabel = Freestyle
pic1Shape = 1
#
pic2OutputFormat = jpg
pic2RadioLabel = Profile
pic2Shape = 1
pic2PreserveRatio = true
pic2TargetHeight = 125
pic2TargetWidth = 85
#
pic3OutputFormat = png
pic3RadioLabel = Oval PNG
pic3Shape = 2
pic3PreserveRatio = true
pic3TargetHeight = 100
pic3TargetWidth = 100
#
pic4OutputFormat = jpg
pic4RadioLabel = Oval JPG
pic4Shape = 2
pic4PreserveRatio = true
pic4TargetHeight = 100
pic4TargetWidth = 100
The @tokens@ between at (@) symbols are build time replacements
used by Maven Ant plugin to properly substitute proper Maven
profile. For example, Maven can build Web Start configuration URL
for either localhost or real url, in our case bambieditor.sourceforge.net.