FacesBean bean) throws IOException
{
ResponseWriter writer = context.getResponseWriter();
StyleContext sContext = ((CoreRenderingContext) arc).getStyleContext();
StyleProvider provider = sContext.getStyleProvider();
if (provider != null)
{
String href = provider.getStyleSheetURI(sContext);
// If the requestMap has a skin-id, a skin's stylesheet's id and suppressStylesheet
// is true, and the skin information matches our current skin, then it is safe
// to not write out the css. This means that it will be written out by the external
// source, like the portal container.
boolean suppressStylesheet = _isSuppressStylesheet(context, arc);
if (!suppressStylesheet)
{
if (href != null)
{
ExternalContext externalContext = context.getExternalContext();
String contextUri = externalContext.getRequestContextPath();
String baseURL = contextUri + XhtmlConstants.STYLES_CACHE_DIRECTORY;
String outputMode = arc.getOutputMode();
// =-=AEW Don't like hardcoding facet names...
if (XhtmlConstants.OUTPUT_MODE_PORTLET.equals(outputMode) &&
supportsScripting(arc))
{
writer.startElement("script", null);
writer.writeText("var _adfSS;if(!_adfSS){_adfSS=1;document.write(\"" +
"<link rel=\\\"stylesheet\\\" "+
"charset=\\\"UTF-8\\\" type=\\\"text/css\\\" " +
"href=\\\"",
null);
String uri = context.getExternalContext().encodeResourceURL(baseURL+href);
writer.writeText(uri, null);
writer.writeText("\\\">\")}", null);
writer.endElement("script");
}
else
{
writer.startElement("link", null);
renderId(context, comp);
writer.writeAttribute("rel", "stylesheet", null);
writer.writeAttribute("charset", "UTF-8", null);
String type = provider.getContentStyleType(sContext);
writer.writeAttribute("type", type, null);
renderEncodedResourceURI(context, "href", baseURL + href);
writer.endElement("link");
}