com.jalios.jcmsplugin.readspeaker
Class ReadSpeaker

java.lang.Object
  extended by com.jalios.jcmsplugin.readspeaker.ReadSpeaker
All Implemented Interfaces:
JPropertiesListener

public class ReadSpeaker
extends Object
implements JPropertiesListener


Field Summary
static String REVISION
           
 
Method Summary
 String getDisplayTemplate(Publication pub)
          If a ReadSpeaker template is available for this publication returns it ; otherwise returns the display template.
static ReadSpeaker getInstance()
          Returns the singleton.
 String getReadSpeakerUrl(Publication pub, String userLang)
          Returns the ReadSpeaker URL for the given publication in the given language (i.e. the URL to access the mp3).
 String getReadSpeakerUrl(Publication pub, String userLang, boolean getMp3Url)
          eturns the ReadSpeaker URL for the given publication in the given language (i.e. the URL to access the MP3).
 String getReadSpeakerUrlPrefix()
          Returns the ReadSpeaker URL Prefix.
 String getUrlToRead(Publication pub, String userLang)
          Returns the URL for the given publication to be read by readspeaker.
 boolean isReadable(Publication pub)
          Checks if the given publication is readable.
 void propertiesChange(JProperties properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Method Detail

getInstance

public static ReadSpeaker getInstance()
Returns the singleton. Caution: This method is not thread-safe.

Returns:
the singleton.
Since:
rsp-1.0

isReadable

public boolean isReadable(Publication pub)
Checks if the given publication is readable.

Parameters:
pub - the publication
Returns:
true if the given publication is readable.
Since:
jcms-5.7.2

getUrlToRead

public String getUrlToRead(Publication pub,
                           String userLang)
Returns the URL for the given publication to be read by readspeaker.

Parameters:
pub - the publication to be read
userLang - the user language
Returns:
the URL forthe given publication to be read by readspeaker.
Since:
rsp-1.0

getReadSpeakerUrlPrefix

public String getReadSpeakerUrlPrefix()
Returns the ReadSpeaker URL Prefix.

Returns:
the ReadSpeaker URL Prefix.
Since:
rsp-1.0

getReadSpeakerUrl

public String getReadSpeakerUrl(Publication pub,
                                String userLang)
Returns the ReadSpeaker URL for the given publication in the given language (i.e. the URL to access the mp3).

Parameters:
pub - the publication to be read
userLang - the user language
Returns:
the ReadSpeaker URL for the given publication in the given language.
Since:
rsp-1.0

getReadSpeakerUrl

public String getReadSpeakerUrl(Publication pub,
                                String userLang,
                                boolean getMp3Url)
eturns the ReadSpeaker URL for the given publication in the given language (i.e. the URL to access the MP3). If getMp3Url is true, perform a request to ReadSpeaker server to get the URL to access directly the MP3.

Parameters:
pub - the publication
userLang - the userLanguage
getMp3Url - if true get the direct URL to access the MP3
Returns:
the ReadSpeaker URL for the given publication in the given language.
Since:
jcms-5.7.2

getDisplayTemplate

public String getDisplayTemplate(Publication pub)
If a ReadSpeaker template is available for this publication returns it ; otherwise returns the display template.

Parameters:
pub - the publication
Returns:
a ReadSpeaker template or a display template.
Since:
rsp-1.0

propertiesChange

public void propertiesChange(JProperties properties)
Specified by:
propertiesChange in interface JPropertiesListener


Copyright © 2001-2007 Jalios SA. All Rights Reserved.