final StringBuilder s = new StringBuilder();
s.append( "\n<script language=\"javascript\" type=\"text/javascript\">\n" );
s.append( " Dashboards.context = " );
s.append( contextObj.toString( 2 ) + "\n" );
View view = ViewsEngine.getInstance().getView( ( viewId.isEmpty() ? action : viewId ), user );
if ( view != null ) {
s.append( "Dashboards.view = " );
s.append( view.toJSON().toString( 2 ) + "\n" );
}
String storage = getStorage();
if ( !"".equals( storage ) ) {
s.append( "Dashboards.initialStorage = " );
s.append( storage );