Versions Compared

Key

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

...

1. Determine the Media Type

All media element supported by Sousa must have a file extention and MIME type associated with them. Generally, standard MIME types should be used. See http://www.feedforall.com/mime-types.htm for an all in one list, or the official list at http://www.iana.org/assignments/media-types/.

Resource Tool Types

In some cases, the Sakai Resource tool has already defined a media type. The following line in AddItemProducer (in the Page tool) can be enabled to see all media types going by:

...

Thus we learn that the item "Nolaria.com" has a media type of "text/url".

Registering the Media Type

Media types are registered in the ContentElementHandler class of the Sousa content handler package (sousa-content/util). Create a new registered type using code like this:

Code Block
java
java

//	Add the URL media type.
handler = new CEUrl();
this.media.put ("text/url", handler);
this.types.add (new MediaType("text/url", "url", "URL", handler));

If several extensions or MIME types are managed by the same handler, add them.

2. Create a ContentElement Class

...