facesContext.getAttributes().containsKey(JAVASCRIPT_ENCODED_JSF2))
{
return;
}
AddResource addresource = AddResourceFactory.getInstance(facesContext);
// Add the javascript and CSS pages
String styleLocation = HtmlRendererUtils.getStyleLocation(component);
if(styleLocation==null)
{
/*
String styleLibrary = (String) component.getAttributes().get(LibraryLocationAware.STYLE_LIBRARY_ATTR);
if (styleLibrary == null)
{
//addresource.addStyleSheet(facesContext, AddResource.HEADER_BEGIN, HtmlCalendarRenderer.class, "WH/theme.css");
TomahawkResourceUtils.addOutputStylesheetResource(facesContext, "oam.custom.calendar.WH", "theme.css");
//addresource.addStyleSheet(facesContext, AddResource.HEADER_BEGIN, HtmlCalendarRenderer.class, "DB/theme.css");
TomahawkResourceUtils.addOutputStylesheetResource(facesContext, "oam.custom.calendar.DB", "theme.css");
}
else
{
TomahawkResourceUtils.addOutputStylesheetResource(facesContext, styleLocation, "theme.css");
}*/
}
else if (!RESOURCE_NONE.equals(styleLocation))
{
addresource.addStyleSheet(facesContext, AddResource.HEADER_BEGIN, styleLocation+"/theme.css");
}
else
{
// output nothing; presumably the page directly references the necessary stylesheet
}
String javascriptLocation = HtmlRendererUtils.getJavascriptLocation(component);
if(javascriptLocation==null)
{
/*
String javascriptLibrary = (String) component.getAttributes().get(LibraryLocationAware.JAVASCRIPT_LIBRARY_ATTR);
if (javascriptLibrary == null)
{
//addresource.addJavaScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, PrototypeResourceLoader.class, "prototype.js");
TomahawkResourceUtils.addOutputScriptResource(facesContext, "oam.custom.prototype", "prototype.js");
//addresource.addJavaScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, HtmlCalendarRenderer.class, "date.js");
TomahawkResourceUtils.addOutputScriptResource(facesContext, "oam.custom.calendar", "date.js");
//addresource.addJavaScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, HtmlCalendarRenderer.class, "popcalendar.js");
TomahawkResourceUtils.addOutputScriptResource(facesContext, "oam.custom.calendar", "popcalendar.js");
}
else
{
TomahawkResourceUtils.addOutputScriptResource(facesContext, javascriptLibrary, "prototype.js");
TomahawkResourceUtils.addOutputScriptResource(facesContext, javascriptLibrary, "date.js");
TomahawkResourceUtils.addOutputScriptResource(facesContext, javascriptLibrary, "popcalendar.js");
}*/
}
else if (!RESOURCE_NONE.equals(javascriptLocation))
{
addresource.addJavaScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javascriptLocation+ "/prototype.js");
addresource.addJavaScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javascriptLocation+ "/date.js");
addresource.addJavaScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javascriptLocation+ "/popcalendar.js");
}
else
{
// output nothing; presumably the page directly references the necessary javascript
}