*/
public ConcreteElement getContent( RunData rundata,
CapabilityMap map,
boolean allowRecurse ) {
CapabilityMap mymap = map;
if ( mymap == null ) mymap = CapabilityMapFactory.getCapabilityMap( rundata );
ConcreteElement element = (ConcreteElement)content.get( mymap.toString() );
if ( element == null ) {
if ( allowRecurse ) {
try {
// init will put content under default cmap
init( );
element = getContent( rundata, mymap, false );
if( element != null ) {
// now we put it under our cmap
this.setContent( element, mymap );
}
} catch (Exception e) {
element = new JetspeedClearElement("Error when retrieving Portlet contents");
if( logger.isDebugEnabled() ) {
logger.debug( "Error when retrieving Portlet contents", e );
}
}
} else {
if( element == null ) {
//FIXME: Let's asume that the contents under "default" map are good
mymap = CapabilityMapFactory.getDefaultCapabilityMap();
element = (ConcreteElement)content.get( mymap.toString() );
if( element == null ) {
element = new JetspeedClearElement("Unknown Problem getting Contents");
}
}
}