Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 225536 | Differences between
and this patch

Collapse All | Expand All

(-)birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java (+25 lines)
Lines 895-900 Link Here
895
	 * 
895
	 * 
896
	 * @param request
896
	 * @param request
897
	 * @return
897
	 * @return
898
	 *
899
	 * @deprecated replaced by {@link #getRtl}
898
	 */
900
	 */
899
901
900
	public static boolean isRtl( HttpServletRequest request )
902
	public static boolean isRtl( HttpServletRequest request )
Lines 910-915 Link Here
910
	}
912
	}
911
913
912
	/**
914
	/**
915
	 * Retrieves the viewer rtl option.
916
	 * 
917
	 * @param request
918
	 * @return The rtl option
919
	 * @author bidi_hcg
920
	 */
921
922
	public static Boolean getRtl( HttpServletRequest request )
923
	{
924
		String rtl = getParameter( request, PARAM_RTL );
925
926
		if ( String.valueOf( Boolean.TRUE ).equalsIgnoreCase( rtl ) )
927
		{
928
			return Boolean.TRUE;
929
		}	
930
		if ( String.valueOf( Boolean.FALSE ).equalsIgnoreCase( rtl ) )
931
		{
932
			return Boolean.FALSE;
933
		}	
934
		return null;
935
	}
936
937
	/**
913
	 * Get report locale from a given string.
938
	 * Get report locale from a given string.
914
	 * 
939
	 * 
915
	 * @param locale
940
	 * @param locale
(-)birt/webcontent/birt/pages/layout/RunFragment.jsp (-1 / +2 lines)
Lines 38-44 Link Here
38
	Viewer run fragment
38
	Viewer run fragment
39
-----------------------------------------------------------------------------%>
39
-----------------------------------------------------------------------------%>
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
41
<HTML>
41
<!-- bidi_hcg: add the root direction -->
42
<HTML DIR="<%= attributeBean.getOrientation( ) %>">
42
	<HEAD>
43
	<HEAD>
43
		<TITLE><%= attributeBean.getReportTitle( ) %></TITLE>
44
		<TITLE><%= attributeBean.getReportTitle( ) %></TITLE>
44
		<BASE href="<%= baseHref %>" >
45
		<BASE href="<%= baseHref %>" >
(-)birt/webcontent/birt/pages/layout/FramesetFragment.jsp (-1 / +2 lines)
Lines 38-44 Link Here
38
	Viewer root fragment
38
	Viewer root fragment
39
-----------------------------------------------------------------------------%>
39
-----------------------------------------------------------------------------%>
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
41
<HTML>
41
<!-- bidi_hcg: add the root direction -->
42
<HTML DIR="<%= attributeBean.getOrientation( ) %>">
42
	<HEAD>
43
	<HEAD>
43
		<TITLE><%= attributeBean.getReportTitle( ) %></TITLE>
44
		<TITLE><%= attributeBean.getReportTitle( ) %></TITLE>
44
		<BASE href="<%= baseHref %>" >
45
		<BASE href="<%= baseHref %>" >
(-)birt/webcontent/birt/pages/layout/RequesterFragment.jsp (-1 / +2 lines)
Lines 34-40 Link Here
34
%>
34
%>
35
35
36
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
36
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
37
<HTML>
37
<!-- bidi_hcg: add the root direction -->
38
<HTML DIR="<%= attributeBean.getOrientation( ) %>">
38
	<HEAD>
39
	<HEAD>
39
		<TITLE>PARAMETER SELECTION PAGE</TITLE>
40
		<TITLE>PARAMETER SELECTION PAGE</TITLE>
40
		<BASE href="<%= baseHref %>" >
41
		<BASE href="<%= baseHref %>" >
(-)birt/WEB-INF/classes/org/eclipse/birt/report/context/ViewerAttributeBean.java (-1 / +1 lines)
Lines 232-238 Link Here
232
		InputOptions options = new InputOptions( );
232
		InputOptions options = new InputOptions( );
233
		options.setOption( InputOptions.OPT_REQUEST, request );
233
		options.setOption( InputOptions.OPT_REQUEST, request );
234
		options.setOption( InputOptions.OPT_LOCALE, locale );
234
		options.setOption( InputOptions.OPT_LOCALE, locale );
235
		options.setOption( InputOptions.OPT_RTL, new Boolean( rtl ) );
235
		options.setOption( InputOptions.OPT_RTL, rtl );
236
236
237
		// Get parameter definition list
237
		// Get parameter definition list
238
		this.parameterDefList = getReportService( ).getParameterDefinitions(
238
		this.parameterDefList = getReportService( ).getParameterDefinitions(
(-)birt/WEB-INF/classes/org/eclipse/birt/report/context/BaseAttributeBean.java (-4 / +54 lines)
Lines 19-25 Link Here
19
19
20
import javax.servlet.http.HttpServletRequest;
20
import javax.servlet.http.HttpServletRequest;
21
21
22
import org.eclipse.birt.report.engine.api.IReportRunnable;
22
import org.eclipse.birt.report.engine.api.ReportParameterConverter;
23
import org.eclipse.birt.report.engine.api.ReportParameterConverter;
24
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
23
import org.eclipse.birt.report.service.BirtViewerReportDesignHandle;
25
import org.eclipse.birt.report.service.BirtViewerReportDesignHandle;
24
import org.eclipse.birt.report.service.api.IViewerReportDesignHandle;
26
import org.eclipse.birt.report.service.api.IViewerReportDesignHandle;
25
import org.eclipse.birt.report.service.api.IViewerReportService;
27
import org.eclipse.birt.report.service.api.IViewerReportService;
Lines 145-151 Link Here
145
	 * RTL option.
147
	 * RTL option.
146
	 */
148
	 */
147
149
148
	protected boolean rtl = false;
150
	protected Boolean rtl = null;
149
151
150
	/**
152
	/**
151
	 * determin whether the link is a toc or bookmark
153
	 * determin whether the link is a toc or bookmark
Lines 233-239 Link Here
233
	protected void init( HttpServletRequest request ) throws Exception
235
	protected void init( HttpServletRequest request ) throws Exception
234
	{
236
	{
235
		this.locale = ParameterAccessor.getLocale( request );
237
		this.locale = ParameterAccessor.getLocale( request );
236
		this.rtl = ParameterAccessor.isRtl( request );
238
		this.rtl = ParameterAccessor.getRtl( request );
237
		this.reportletId = ParameterAccessor.getReportletId( request );
239
		this.reportletId = ParameterAccessor.getReportletId( request );
238
		this.__init( request );
240
		this.__init( request );
239
	}
241
	}
Lines 249-255 Link Here
249
		InputOptions options = new InputOptions( );
251
		InputOptions options = new InputOptions( );
250
		options.setOption( InputOptions.OPT_REQUEST, request );
252
		options.setOption( InputOptions.OPT_REQUEST, request );
251
		options.setOption( InputOptions.OPT_LOCALE, locale );
253
		options.setOption( InputOptions.OPT_LOCALE, locale );
252
		options.setOption( InputOptions.OPT_RTL, new Boolean( rtl ) );
254
		options.setOption( InputOptions.OPT_RTL, rtl );
253
255
254
		Collection parameterList = this.getReportService( )
256
		Collection parameterList = this.getReportService( )
255
				.getParameterDefinitions( reportDesignHandle, options, false );
257
				.getParameterDefinitions( reportDesignHandle, options, false );
Lines 420-426 Link Here
420
	 */
422
	 */
421
	public boolean isRtl( )
423
	public boolean isRtl( )
422
	{
424
	{
423
		return rtl;
425
		return Boolean.TRUE.equals( rtl );
424
	}
426
	}
425
427
426
	/**
428
	/**
Lines 584-587 Link Here
584
	{
586
	{
585
		this.documentInUrl = documentInUrl;
587
		this.documentInUrl = documentInUrl;
586
	}
588
	}
589
590
	/**
591
	 * Gets the HTML/CSS equivalent of the {@link #rtl} flag.
592
	 * 
593
	 * @return the {@link org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants#CSS_RTL_VALUE}
594
	 * or {@link org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants#CSS_LTR_VALUE}
595
	 * 
596
	 * @author bidi_hcg
597
	 */
598
	public String getOrientation( )
599
	{
600
		return Boolean.TRUE.equals( rtl ) ? CSSConstants.CSS_RTL_VALUE
601
				: CSSConstants.CSS_LTR_VALUE;
602
	}
603
604
	/**
605
	 * Updates the rtl flag based on the report design orientation.
606
	 *
607
	 * @author bidi_hcg
608
	 */
609
	protected void fixOrientation( HttpServletRequest request ) throws Exception
610
	{
611
		if ( this.rtl != null ) // already was obtained from HTTP request before
612
			return;
613
614
		IViewerReportDesignHandle handle = getDesignHandle( request );
615
		if ( handle != null )
616
		{
617
			Object designObject = getDesignHandle( request ).getDesignObject( );
618
			if ( designObject instanceof IReportRunnable )
619
			{
620
				if ( ( (IReportRunnable) designObject ).getDesignHandle( )
621
						.isDirectionRTL( ) )
622
				{
623
					this.rtl = Boolean.TRUE;
624
					request.setAttribute( InputOptions.OPT_RTL,
625
							Boolean.TRUE );
626
				}
627
				else
628
				{
629
					this.rtl = Boolean.FALSE;
630
					request.setAttribute( InputOptions.OPT_RTL, Boolean.FALSE );
631
				}
632
			}
633
		}
634
		if ( this.rtl == null )
635
			request.removeAttribute( InputOptions.OPT_RTL );
636
	}
587
}
637
}
(-)birt/WEB-INF/classes/org/eclipse/birt/report/context/BirtContext.java (+12 lines)
Lines 44-48 Link Here
44
			bean = new ViewerAttributeBean( request );
44
			bean = new ViewerAttributeBean( request );
45
		}
45
		}
46
		request.setAttribute( IBirtConstants.ATTRIBUTE_BEAN, bean );
46
		request.setAttribute( IBirtConstants.ATTRIBUTE_BEAN, bean );
47
48
		// bidi_hcg start
49
		// Update the rtl flag of the bean
50
		try
51
		{
52
			bean.fixOrientation( request );
53
		}
54
		catch ( Exception e )
55
		{
56
			bean.exception = e;
57
		}
58
		// bidi_hcg end
47
	}
59
	}
48
}
60
}
(-)src/org/eclipse/birt/report/viewer/utilities/WebViewer.java (+5 lines)
Lines 341-346 Link Here
341
				.getString( PREVIEW_MAXINMEMORYCUBESIZE );
341
				.getString( PREVIEW_MAXINMEMORYCUBESIZE );
342
342
343
		// get -dir rtl option
343
		// get -dir rtl option
344
		// bidi_hcg: TODO We won't derive orientation from the eclipse options,
345
		// so disable this chunk of code.
346
		// "__rtl" parameter will be still supported to back the scenario when
347
		// is passed from outside of Designer.
344
		boolean rtl = false;
348
		boolean rtl = false;
345
		String eclipseCommands = System.getProperty( "eclipse.commands" ); //$NON-NLS-1$
349
		String eclipseCommands = System.getProperty( "eclipse.commands" ); //$NON-NLS-1$
346
		if ( eclipseCommands != null )
350
		if ( eclipseCommands != null )
Lines 412-417 Link Here
412
				+ ( LocaleTable.containsKey( locale )
416
				+ ( LocaleTable.containsKey( locale )
413
						? "&__locale=" + LocaleTable.get( locale ) : "" ) //$NON-NLS-1$ //$NON-NLS-2$
417
						? "&__locale=" + LocaleTable.get( locale ) : "" ) //$NON-NLS-1$ //$NON-NLS-2$
414
				+ "&__masterpage=" + String.valueOf( bMasterPageContent ) //$NON-NLS-1$
418
				+ "&__masterpage=" + String.valueOf( bMasterPageContent ) //$NON-NLS-1$
419
				// bidi_hcg: TODO Remove rtl, see comment above.
415
				+ "&__rtl=" + String.valueOf( rtl ) //$NON-NLS-1$
420
				+ "&__rtl=" + String.valueOf( rtl ) //$NON-NLS-1$
416
				+ ( maxrows != null && maxrows.trim( ).length( ) > 0
421
				+ ( maxrows != null && maxrows.trim( ).length( ) > 0
417
						? "&__maxrows=" + maxrows : "" ) //$NON-NLS-1$ //$NON-NLS-2$
422
						? "&__maxrows=" + maxrows : "" ) //$NON-NLS-1$ //$NON-NLS-2$

Return to bug 225536