Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Created a branch for 2.5.x sousa by copying the current trunk before checking in 2.6.0 changes.

Aug. 19, 2008

Was giving some thought to external registration of media types in Sousa. The ContentElementHandler object handles type registration (actually using two methods). It was fairly simple to add a method to add a new handler:

Code Block
java
java

	/*
	 *	Add a new content handler to the list of supported types.  This method is intended to support
	 *	external registration of content handlers.  Types built into Sousa should be intialized in the
	 *	ContentElementHandler constructor above.
	 */
	public void addHandler (String type, String extension, String name, CEBase handler) {
		this.types.add (new MediaType(type, extension, name, handler));
	}

The question is, how does this method get invoked outside of a Sousa tool? I could set up ContentElementHandler such at it is a Sakai component, registered with the ComponentManager, but some piece of code would still have to fetch it and call the addHandler method. I suspect the answer is Spring. If I create a singleton handler based on CEBase and register it with Spring, it should be initialized at start up time. In the init() method, I can call ContentElementHandler.addHandler(), if it's available.

Check this change in as rev. 52188.