burtonator wrote:
>
> This is a quick proposal for building out Jetspeed's WAP support.
>
I was planning to do this last week-end but got caught in fixing other things
in Jetspeed se my other posts...
> The only difference I want between Cocoon and Jetspeed in this is that
> Cocoon will handle the multiple types and Jetspeed piece everything
> together. The other issue is that any Portlet doesn't necessarily have
> to use Cocoon or even XML, it could use ECS if it wanted. Choice is
> good :)
>
+1
> Introspection support needs to be worked into Portlets. We should use a
> db of HTTP_USER_AGENTS to determine client capabilities. The
> introspection can then only provide data that the client can handle.
> This concept maps to Cocoon media types very well.
>
I don't think Portlet should introspect.
My target architecture is the following :
We introduce 2 new component types :
Profiler : whose goal is to select the information presented based on request
information
interface Profiler {
init ( confURL )
getResourceURL( RunData )
CapabilityMap getCapabilities( RunData )
}
CapabilityMap : who keeps the user-agent to capability db.
class CapabilityMap {
static final int TABLE = 0;
static final int JAVASCRIPT1.0 = 1;
...
MimeType getType()
boolean hasOption( int )
}
[MimeType information is not enough for what we have in mind, because a lot of
thin clients supports HTML but without tables, javascript, etc... and I want jetspeed
to be smart enough to accomodate them.]
Let's introduce a new property in Config
setCapabilityMap()
getCapabilityMap()
and a new method in Portlet and PortletController
MimeType[] getSupportedTypes()
The instancation model would become :
in Home
Profiler profiler = ProfilerFactory.getProfiler( rundata );
PortletSet portlets = PortletSetFactory.getInstance( profiler ).getPortletSet(
rundata );
content = portlets.getContent();
in the factory:
PortletSetFactory.getInstance ( profiler ) {
setProfiler( profiler );
return getInstance( profiler.getResourceURL() );
}
for each portlet found in the PSML file, check if map.getType is included in
portlet.getSupportedTypes(), if so put the portlet in the set else don't include
it.
When getContent() or init() is called, it's the responsibility of the portlet,
protletcontroller to check the capabilitymap in its config and generate the correct
output.
For Cocoon based portlets, the getSupportedTypes can be implemented by checking if
a corresponding stylesheet is available in the registry:
getSupportedTypes() {
Vector types = new Vector();
if ( getPortletConfig().getInitParameter("stylesheet") )
types.addElement( new MimeType("text/html");
if ( getPortletConfig().getInitParameter("wml_stylesheet") )
types.addElement( new MimeType("text/wml");
if ( getPortletConfig().getInitParameter("xhtml_stylesheet") )
types.addElement( new MimeType("text/xhtml");
return (MimeType[])types.toArray();
}
I've already implemented the Profiler part, the capabilityMap should be very
difficult
to do, the main task is to modify all portlets to take advantage of this feature...
I'm just waiting for the CVS tree to be open for new features... :)
--
Rapha�l Luta - [EMAIL PROTECTED]
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]