You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Michele Cella <mi...@gmail.com> on 2005/08/13 19:34:06 UTC

Custom portlet mode

Hi list,

I'm working on a Jetspeed-2 project where I need to provide text to 
speech of the portlet content.

Back in November/December I've done the same thing on Jetspeed-1 [1], 
now I need to port the whole thing to Jetspeed-2.

But this time I aim to be unobtrusive as much as possible. This means:
- JSR-168 compliance
- no changes to the jetspeed core
- easy deployment as a single .war

I known I will need to port my text to speech Turbine service to the new 
Spring framework.

But I need to ask some questions:
- What's the best way to make a portlet that implements a custom mode 
(Speak)?
- How can I provide a good framework that simplifies the development of 
velocity based speaking portlets?
- This time I want to put the audio content inside a flash (.swf) file 
(previously it was written directly on the output stream) and embed it 
on the portlet, where should I put this swf file I'm building? Does 
Jetspeed provide any cache facilities?

Any advice and/or opinion would really be appreciated.

Ciao
Michele

[1] http://thread.gmane.org/gmane.comp.jakarta.jetspeed.devel/15349


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Custom portlet mode

Posted by Michele Cella <mi...@gmail.com>.
David Sean Taylor wrote:
> No, I like you're idea.

Great.

> 
> First let me ask, does the text-to-speech spring service have an Apache 
> friendly license?

I haven't yet ported the text-to-speech service from Turbine to the 
spring framework, anyway ATM the service it's really simple and my 
implementation it's based upon the FreeTTS engine.
I'm not familiar with licensing issues but I think we should check the 
license under which FreeTTS it's being released [1] to ensure Apache 
compatibility, right?

> 
> As for the [Play] [Stop] [Volume] actions, this is probably something 
> best provided in a base portlet class that can be extended, or even via 
> a special portlet decorator that adds the [Play] [Stop] [Volume] actions 
> when in Speech mode.

Yes, thank you for pointing this out.
I will take a look at both methods, regarding special portlet decorators 
  any suggestion or example to start from?

> 
> This sounds like a great addition to Jetspeed. Are you planning on 
> contributing it to Apache?

I will be glad to contributing it.
I will release my code under the Apache license, now I hope FreeTTS and 
JGenerator (the only library I've found to build flash file) are apache 
compatible.

Thank you again.

Ciao
Michele

PS
It seems as JGenerator uses an apache style license [2].


[1] http://freetts.sourceforge.net/license.terms
[2] http://www.flashgap.com/license.txt


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Custom portlet mode

Posted by David Sean Taylor <da...@bluesunrise.com>.
Michele Cella wrote:
> 
> Hi David and thank you for your attention,
> 
> Unfortunately, since the text to speech was (and still is) server side 
> generated, I did take another (very radical) solution.
> 
> That's what I've did:
> - added support for a new portlet mode under the 
> org.apache.jetspeed.portal.PortletState class (as a new allowSpeak() 
> method) and its related portlet action (Speak) under the 
> org.apache.jetspeed.portal.controls.VelocityPortletControl class (to 
> provide a new icon on the portlet decorator).
> - implemented the org.apache.jetspeed.modules.actions.controls.Speak 
> class to manage the new action via a Turbine RawScreen (named Speak)
> - implemented the org.apache.jetspeed.modules.screens.Speak class to 
> write the text to speech on the portlet response output stream using a 
> new service
> - added a new getContentToSpeech() method under the 
> org.apache.jetspeed.portal.Portlet class to give portlets a way to 
> customize the content to syntethize
> - implemented a new TextToSpeech service (and its 
> FreeTTSTextToSpeechService implementation) that writes to an output 
> stream (as a wav audio file) the text to speech of a given text
> - implemented support for taking advantage on the new Speak mode inside 
> RSS portlets (using a separate xsl styleshett) and Velocity portlets 
> (using an opportune velocity template)
> 
> I'm conscious that this is not a nice solution, moreover the browser 
> needs an external player to play the wav file.
> 
> As you say media types, psml files and supports for custom mode is the 
> way to go, but IMHO this solution is only applicable in a SSML enabled 
> world [1], where the text to speech is generated by the browser itself.
> 
> Now, I think that for my requirements the only practicable solution is 
> implementing a new Spring service that every portlet can take advantage of.
> This service should provide an easy way for every portlet to embed 
> (under its fragment content) a controller (Play,Stop,Volume) that lets 
> (via JavaScript) the user playing an embedded flash file that contains 
> the text to speech.
> Every portlet can hide or show this control using an adeguate portlet 
> preference.
> This idea takes its inspiration from the Speegle search engine [2], the 
> final result should be something like this:
> 
>  ______________________________________
> | Speaking Portlet                 _ x |
> |______________________________________|
> |                                      |
> |                                      |
> |                                      |
> |         Portlet Content              |
> |                                      |
> |                                      |
> |______________________________________|
> | |Play|    |Stop|            |Volume| |
>  --------------------------------------
> 
> Probably my approach it's totally wrong, what do you think?
> 
No, I like you're idea.

First let me ask, does the text-to-speech spring service have an Apache 
friendly license?

As for the [Play] [Stop] [Volume] actions, this is probably something 
best provided in a base portlet class that can be extended, or even via 
a special portlet decorator that adds the [Play] [Stop] [Volume] actions 
when in Speech mode.

This sounds like a great addition to Jetspeed. Are you planning on 
contributing it to Apache?


-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Custom portlet mode

Posted by Michele Cella <mi...@gmail.com>.
David Sean Taylor wrote:
> Michele Cella wrote:
> 
>> Hi list,
>>
>> I'm working on a Jetspeed-2 project where I need to provide text to 
>> speech of the portlet content.
>>
>> Back in November/December I've done the same thing on Jetspeed-1 [1], 
>> now I need to port the whole thing to Jetspeed-2.
>>
>> But this time I aim to be unobtrusive as much as possible. This means:
>> - JSR-168 compliance
>> - no changes to the jetspeed core
>> - easy deployment as a single .war
>>
>> I known I will need to port my text to speech Turbine service to the 
>> new Spring framework.
>>
>> But I need to ask some questions:
>> - What's the best way to make a portlet that implements a custom mode 
>> (Speak)?
> 
> 
> 
> We haven't tried to add custom portlet mode support yet.
> I'd be glad to help implement custom portlet modes if required as its
> long overdue
> 
> Note that Jetspeed-2 does have the same profiling and page layout
> support for media types as Jetspeed-1. Not sure how you did your
> Jetspeed-1 implementation, but if you used the directory based solution,
> its changed a little, the profiler is more generic, so the criteria can
> be anything, such as the _mediatype :
> 
> _mediatype
>   html
>     page1.html
>   wml
>     page1.html
>   vrml
>     page1.html
> 
> or even the user.agent:
> 
> _user.agent
>   ie5mac
>     page1.html
>   page1.html
> 
> 
> Did your solution in J1 use media types and psml files, or did you take 
> a different solution?
> 
>> - How can I provide a good framework that simplifies the development 
>> of velocity based speaking portlets?
> 
> 
> Building in support into the portal for custom modes and media types 
> will be a good foundation

Hi David and thank you for your attention,

Unfortunately, since the text to speech was (and still is) server side 
generated, I did take another (very radical) solution.

That's what I've did:
- added support for a new portlet mode under the 
org.apache.jetspeed.portal.PortletState class (as a new allowSpeak() 
method) and its related portlet action (Speak) under the 
org.apache.jetspeed.portal.controls.VelocityPortletControl class (to 
provide a new icon on the portlet decorator).
- implemented the org.apache.jetspeed.modules.actions.controls.Speak 
class to manage the new action via a Turbine RawScreen (named Speak)
- implemented the org.apache.jetspeed.modules.screens.Speak class to 
write the text to speech on the portlet response output stream using a 
new service
- added a new getContentToSpeech() method under the 
org.apache.jetspeed.portal.Portlet class to give portlets a way to 
customize the content to syntethize
- implemented a new TextToSpeech service (and its 
FreeTTSTextToSpeechService implementation) that writes to an output 
stream (as a wav audio file) the text to speech of a given text
- implemented support for taking advantage on the new Speak mode inside 
RSS portlets (using a separate xsl styleshett) and Velocity portlets 
(using an opportune velocity template)

I'm conscious that this is not a nice solution, moreover the browser 
needs an external player to play the wav file.

As you say media types, psml files and supports for custom mode is the 
way to go, but IMHO this solution is only applicable in a SSML enabled 
world [1], where the text to speech is generated by the browser itself.

Now, I think that for my requirements the only practicable solution is 
implementing a new Spring service that every portlet can take advantage of.
This service should provide an easy way for every portlet to embed 
(under its fragment content) a controller (Play,Stop,Volume) that lets 
(via JavaScript) the user playing an embedded flash file that contains 
the text to speech.
Every portlet can hide or show this control using an adeguate portlet 
preference.
This idea takes its inspiration from the Speegle search engine [2], the 
final result should be something like this:

  ______________________________________
| Speaking Portlet                 _ x |
|______________________________________|
|                                      |
|                                      |
|                                      |
|         Portlet Content              |
|                                      |
|                                      |
|______________________________________|
| |Play|    |Stop|            |Volume| |
  --------------------------------------

Probably my approach it's totally wrong, what do you think?

Thank you again and sorry for my english.

Ciao
Michele

[1] http://www.w3.org/TR/speech-synthesis/
[2] http://www.speegle.co.uk


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Custom portlet mode

Posted by David Sean Taylor <da...@bluesunrise.com>.
Michele Cella wrote:
> Hi list,
> 
> I'm working on a Jetspeed-2 project where I need to provide text to 
> speech of the portlet content.
> 
> Back in November/December I've done the same thing on Jetspeed-1 [1], 
> now I need to port the whole thing to Jetspeed-2.
> 
> But this time I aim to be unobtrusive as much as possible. This means:
> - JSR-168 compliance
> - no changes to the jetspeed core
> - easy deployment as a single .war
> 
> I known I will need to port my text to speech Turbine service to the new 
> Spring framework.
> 
> But I need to ask some questions:
> - What's the best way to make a portlet that implements a custom mode 
> (Speak)?


We haven't tried to add custom portlet mode support yet.
I'd be glad to help implement custom portlet modes if required as its
long overdue

Note that Jetspeed-2 does have the same profiling and page layout
support for media types as Jetspeed-1. Not sure how you did your
Jetspeed-1 implementation, but if you used the directory based solution,
its changed a little, the profiler is more generic, so the criteria can
be anything, such as the _mediatype :

_mediatype
   html
     page1.html
   wml
     page1.html
   vrml
     page1.html

or even the user.agent:

_user.agent
   ie5mac
     page1.html
   page1.html


Did your solution in J1 use media types and psml files, or did you take 
a different solution?

> - How can I provide a good framework that simplifies the development of 
> velocity based speaking portlets?

Building in support into the portal for custom modes and media types 
will be a good foundation


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org