KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > applications > media > urlcomposers > omroep > WmSbURLComposer


1 /*
2   
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5   
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8   
9 */

10
11 package org.mmbase.applications.media.urlcomposers.omroep;
12 import org.mmbase.applications.media.urlcomposers.URLComposer;
13 import java.util.Map JavaDoc;
14
15 /**
16  *
17  * @author Michiel Meeuwissen
18  * @version $Id: WmSbURLComposer.java,v 1.8 2003/11/26 16:48:37 michiel Exp $
19  * @since MMBase-1.7
20  */

21 public class WmSbURLComposer extends URLComposer {
22
23     public boolean canCompose() {
24         return provider.getStringValue("host").equals("cgi.omroep.nl") && provider.getStringValue("rootpath").charAt(0) == '%';
25
26     }
27     
28     protected String JavaDoc getBandPrefix() {
29         return "sb.";
30     }
31
32     protected String JavaDoc getBand() {
33         return "smalband";
34     }
35     public String JavaDoc getGUIIndicator(Map JavaDoc options) {
36         return super.getGUIIndicator(options) + " (" + getBand() + ")";
37     }
38
39
40     protected StringBuffer JavaDoc getURLBuffer() {
41         StringBuffer JavaDoc buff = new StringBuffer JavaDoc("mms://media.omroep.nl");
42         int lastSlash = RealSbURLComposer.addURL(buff, source.getStringValue("url"));
43         if (lastSlash > 0) {
44             buff.insert(lastSlash + 1, getBandPrefix());
45         }
46         return buff;
47     }
48 }
49
50
51
Popular Tags