Zoundry Raven: Custom ToolBarTuesday, March 13, 2007
Screenshot of the toolbar menu: How the toolbar looks after choosing "32x32" and "Show Text": Zoundry Raven: Media StoresMonday, March 5, 2007
One of the limitations in the Blog Writer is that only one Media Repository can be configured. The application does allow the user to associated a new Account with either the configured Media Repository or the built-in uploading capabilities of the given Account (if supported by the blog platform). However, it was always our intention to provide a way to configure multiple instance of media repositories (of different types) and allow the user to associate different media repositories with different blogs and/or blog accounts. In Zoundry Raven, we have done exactly that, and it is the topic of today's post.
When creating a new media store, the New Media Store Wizard is used. This wizard walks the user through the process of creating a new store. It first asks the user to choose a type of media store (and store name). After that, the wizard asks the user to fill in the information needed by the store, such as username/password. This information is type specific, so page two of the wizard will be different depending on the store type chosen. The media store type might be Custom FTP, or it might be a more specific value, such as Ripway FTP. The more specific types are simply there to pre-populate the necessary fields when creating the store. For instance, Ripway FTP and Custom FTP are the essentially the same, except that page two of the wizard will have some values already filled in, such as 'host' and 'url'. Finally, I want to explain a little bit about the store types and where the application gets that list from. As I mentioned, we are using the extensibility features of Raven in order to make the media stores highly pluggable. Here's how it works. There are two extension points exposed by Raven that plugins can contribute to. The first is the 'zoundry.blogapp.mediastore.type' extension point. This extension point allows plugins to contribute new media store types to the application. Media store types would be things like FTP, WebDAV, Flickr, etc. For the most part, there would be a single media store type contributed for each protocol/API that might be used to upload images to a remote site. Here is an example of the FTP media store type that will ship with Raven.
<zoundry-extension point="zoundry.blogapp.mediastore.type">
<id>zoundry.blogapp.mediastore.type.ftp</id>
<class>zoundry.blogapp.services.mediastore.providers.ftpprovider.ZFTPMediaStoreProvider</class>
<extension-data>
<media-store-type>
<icon>icons/types/ftp.png</icon>
<properties>
<property name="host">
<display-name>Host</display-name>
<tooltip>The FTP host. (Example: ftp.myftphost.com)</tooltip>
<validation-regexp>.+</validation-regexp>
<validation-error-message>A value for 'host' is required.</validation-error-message>
</property>
<property name="port">
<display-name>Port</display-name>
<default-value>21</default-value>
<tooltip>The FTP Port (Example: 21)</tooltip>
<validation-regexp>\d+</validation-regexp>
<validation-error-message>A value for 'port' is required (and must be a number).</validation-error-message>
</property>
<property name="username">
<display-name>Username</display-name>
<tooltip>Your FTP username.</tooltip>
<validation-regexp>.+</validation-regexp>
<validation-error-message>A value for 'username' is required.</validation-error-message>
</property>
<property name="password">
<display-name>Password</display-name>
<tooltip>Your FTP password.</tooltip>
<type>password</type>
</property>
<property name="path">
<display-name>FTP Path</display-name>
<tooltip>Path on the remote FTP server. (Example: /mypix)</tooltip>
<default-value>/</default-value>
</property>
<property name="url">
<display-name>URL</display-name>
<tooltip>URL used to retrieve uploaded files. (Example: http://www.myftphost.com/myusername/mypix/)</tooltip>
<validation-regexp>(.+):.+</validation-regexp>
<validation-error-message>A valid 'url' is required.</validation-error-message>
</property>
<property name="passive">
<display-name>Use 'passive' FTP</display-name>
<tooltip>Active/Passive FTP mode. (If your settings do not work, try changing the value of 'passive')</tooltip>
<type>checkbox</type>
<default-value>false</default-value>
</property>
</properties>
<capabilities>
<capability enabled="true" id="zoundry.raven.capability.mediastore.supports-delete"/>
<capability enabled="true" id="zoundry.raven.capability.mediastore.supports-file-list"/>
</capabilities>
</media-store-type>
</extension-data>
</zoundry-extension>
<zoundry-extension point="zoundry.blogapp.mediastore.site">
<id>zoundry.blogapp.mediastore.site.ripway</id>
<class/>
<extension-data>
<media-site>
<media-store-type-id>zoundry.blogapp.mediastore.type.ftp</media-store-type-id>
<display-name>Ripway FTP</display-name>
<icon>icons/sites/ripway.png</icon>
<properties>
<property name="host">
<default-value>ftphost.ripway.com</default-value>
</property>
<property name="url">
<default-value>http://h1.ripway.com/USERNAME/</default-value>
</property>
<property name="passive">
<default-value>true</default-value>
<hidden>true</hidden>
</property>
</properties>
</media-site>
</extension-data>
</zoundry-extension>
The result of all of this complexity is that it is very easy to add new store types and new sites. In fact, third parties could very easily contribute new media store sites without doing any actual coding, as long as those third parties support an API that is already contributed (via a media store type). So if an image host wanted to show up in the list of choices in the New Media Store Wizard, and that image host supports FTP, then they could create a plugin that simply contributed a new media site to the application, much like the Ripway example above. Labels: extensions, media store, raven, zoundry |
|