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 909-914 Link Here
909
		return isRtl;
911
		return isRtl;
910
	}
912
	}
911
913
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
	
912
	/**
937
	/**
913
	 * Get report locale from a given string.
938
	 * Get report locale from a given string.
914
	 * 
939
	 * 
(-)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
}
(-)birt/WEB-INF/classes/org/eclipse/birt/report/service/ReportEngineService.java (+18 lines)
Lines 60-65 Link Here
60
import org.eclipse.birt.report.engine.api.IExtractionResults;
60
import org.eclipse.birt.report.engine.api.IExtractionResults;
61
import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask;
61
import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask;
62
import org.eclipse.birt.report.engine.api.IHTMLRenderOption;
62
import org.eclipse.birt.report.engine.api.IHTMLRenderOption;
63
import org.eclipse.birt.report.engine.api.IPDFRenderOption;
63
import org.eclipse.birt.report.engine.api.IRenderOption;
64
import org.eclipse.birt.report.engine.api.IRenderOption;
64
import org.eclipse.birt.report.engine.api.IRenderTask;
65
import org.eclipse.birt.report.engine.api.IRenderTask;
65
import org.eclipse.birt.report.engine.api.IReportDocument;
66
import org.eclipse.birt.report.engine.api.IReportDocument;
Lines 793-798 Link Here
793
			{
794
			{
794
				renderOption = createPDFRenderOption( servletPath, request,
795
				renderOption = createPDFRenderOption( servletPath, request,
795
						ParameterAccessor.isDesigner( ) );
796
						ParameterAccessor.isDesigner( ) );
797
				// bidi_hcg start
798
				if ( IBirtConstants.PPT_RENDER_FORMAT.equalsIgnoreCase( format ) ) //$NON-NLS-1$
799
				{
800
					// PPT doesn't require Bidi processing.
801
					renderOption.setOption( IPDFRenderOption.PDF_BIDI_PROCESSING,
802
							Boolean.FALSE );
803
				}
804
				// bidi_hcg end
796
			}
805
			}
797
			else
806
			else
798
			{
807
			{
Lines 1162-1167 Link Here
1162
		{
1171
		{
1163
			renderOption = createPDFRenderOption( servletPath, request,
1172
			renderOption = createPDFRenderOption( servletPath, request,
1164
					ParameterAccessor.isDesigner( ) );
1173
					ParameterAccessor.isDesigner( ) );
1174
1175
			// bidi_hcg start
1176
			if ( IBirtConstants.PPT_RENDER_FORMAT.equalsIgnoreCase( format ) ) //$NON-NLS-1$
1177
			{
1178
				// PPT doesn't require Bidi processing.
1179
				renderOption.setOption( IPDFRenderOption.PDF_BIDI_PROCESSING,
1180
						Boolean.FALSE );
1181
			}
1182
			// bidi_hcg end
1165
		}
1183
		}
1166
		else
1184
		else
1167
		{
1185
		{
(-)src/org/eclipse/birt/report/viewer/utilities/WebViewer.java (-2 / +8 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: 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.
348
		/*
344
		boolean rtl = false;
349
		boolean rtl = false;
345
		String eclipseCommands = System.getProperty( "eclipse.commands" ); //$NON-NLS-1$
350
		String eclipseCommands = System.getProperty( "eclipse.commands" ); //$NON-NLS-1$
346
		if ( eclipseCommands != null )
351
		if ( eclipseCommands != null )
Lines 358-364 Link Here
358
				}
363
				}
359
			}
364
			}
360
		}
365
		}
361
366
		*/
362
		if ( "true".equalsIgnoreCase( svgFlag ) ) //$NON-NLS-1$
367
		if ( "true".equalsIgnoreCase( svgFlag ) ) //$NON-NLS-1$
363
		{
368
		{
364
			bSVGFlag = true;
369
			bSVGFlag = true;
Lines 412-418 Link Here
412
				+ ( LocaleTable.containsKey( locale )
417
				+ ( LocaleTable.containsKey( locale )
413
						? "&__locale=" + LocaleTable.get( locale ) : "" ) //$NON-NLS-1$ //$NON-NLS-2$
418
						? "&__locale=" + LocaleTable.get( locale ) : "" ) //$NON-NLS-1$ //$NON-NLS-2$
414
				+ "&__masterpage=" + String.valueOf( bMasterPageContent ) //$NON-NLS-1$
419
				+ "&__masterpage=" + String.valueOf( bMasterPageContent ) //$NON-NLS-1$
415
				+ "&__rtl=" + String.valueOf( rtl ) //$NON-NLS-1$
420
		// bidi_hcg: Disable, see comment above.
421
				//+ "&__rtl=" + String.valueOf( rtl ) //$NON-NLS-1$
416
				+ ( maxrows != null && maxrows.trim( ).length( ) > 0
422
				+ ( maxrows != null && maxrows.trim( ).length( ) > 0
417
						? "&__maxrows=" + maxrows : "" ) //$NON-NLS-1$ //$NON-NLS-2$
423
						? "&__maxrows=" + maxrows : "" ) //$NON-NLS-1$ //$NON-NLS-2$
418
				+ ( maxrowlevels != null && maxrowlevels.trim( ).length( ) > 0
424
				+ ( maxrowlevels != null && maxrowlevels.trim( ).length( ) > 0

Return to bug 225536