Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 96652 Details for
Bug 225536
[Bidi] Support global orientation of report output
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for Viewer revised
viewer_080418.txt (text/plain), 13.07 KB, created by
Lina Kemmel
on 2008-04-18 16:06:29 EDT
(
hide
)
Description:
Patch for Viewer revised
Filename:
MIME Type:
Creator:
Lina Kemmel
Created:
2008-04-18 16:06:29 EDT
Size:
13.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.birt.report.viewer >Index: birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java,v >retrieving revision 1.103 >diff -u -r1.103 ParameterAccessor.java >--- birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java 15 Apr 2008 06:52:20 -0000 1.103 >+++ birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java 18 Apr 2008 20:00:45 -0000 >@@ -895,6 +895,8 @@ > * > * @param request > * @return >+ * >+ * @deprecated replaced by {@link #getRtl} > */ > > public static boolean isRtl( HttpServletRequest request ) >@@ -909,6 +911,29 @@ > return isRtl; > } > >+ /** >+ * Retrieves the viewer rtl option. >+ * >+ * @param request >+ * @return The rtl option >+ * @author bidi_hcg >+ */ >+ >+ public static Boolean getRtl( HttpServletRequest request ) >+ { >+ String rtl = getParameter( request, PARAM_RTL ); >+ >+ if ( String.valueOf( Boolean.TRUE ).equalsIgnoreCase( rtl ) ) >+ { >+ return Boolean.TRUE; >+ } >+ if ( String.valueOf( Boolean.FALSE ).equalsIgnoreCase( rtl ) ) >+ { >+ return Boolean.FALSE; >+ } >+ return null; >+ } >+ > /** > * Get report locale from a given string. > * >Index: birt/webcontent/birt/pages/layout/RunFragment.jsp >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/layout/RunFragment.jsp,v >retrieving revision 1.17 >diff -u -r1.17 RunFragment.jsp >--- birt/webcontent/birt/pages/layout/RunFragment.jsp 9 Jan 2008 06:45:50 -0000 1.17 >+++ birt/webcontent/birt/pages/layout/RunFragment.jsp 18 Apr 2008 20:00:46 -0000 >@@ -38,7 +38,8 @@ > Viewer run fragment > -----------------------------------------------------------------------------%> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> >-<HTML> >+<!-- bidi_hcg: add the root direction --> >+<HTML DIR="<%= attributeBean.getOrientation( ) %>"> > <HEAD> > <TITLE><%= attributeBean.getReportTitle( ) %></TITLE> > <BASE href="<%= baseHref %>" > >Index: birt/webcontent/birt/pages/layout/FramesetFragment.jsp >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/layout/FramesetFragment.jsp,v >retrieving revision 1.29 >diff -u -r1.29 FramesetFragment.jsp >--- birt/webcontent/birt/pages/layout/FramesetFragment.jsp 27 Mar 2008 08:39:31 -0000 1.29 >+++ birt/webcontent/birt/pages/layout/FramesetFragment.jsp 18 Apr 2008 20:00:46 -0000 >@@ -38,7 +38,8 @@ > Viewer root fragment > -----------------------------------------------------------------------------%> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> >-<HTML> >+<!-- bidi_hcg: add the root direction --> >+<HTML DIR="<%= attributeBean.getOrientation( ) %>"> > <HEAD> > <TITLE><%= attributeBean.getReportTitle( ) %></TITLE> > <BASE href="<%= baseHref %>" > >Index: birt/webcontent/birt/pages/layout/RequesterFragment.jsp >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/layout/RequesterFragment.jsp,v >retrieving revision 1.15 >diff -u -r1.15 RequesterFragment.jsp >--- birt/webcontent/birt/pages/layout/RequesterFragment.jsp 16 Oct 2007 05:27:49 -0000 1.15 >+++ birt/webcontent/birt/pages/layout/RequesterFragment.jsp 18 Apr 2008 20:00:46 -0000 >@@ -34,7 +34,8 @@ > %> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> >-<HTML> >+<!-- bidi_hcg: add the root direction --> >+<HTML DIR="<%= attributeBean.getOrientation( ) %>"> > <HEAD> > <TITLE>PARAMETER SELECTION PAGE</TITLE> > <BASE href="<%= baseHref %>" > >Index: birt/WEB-INF/classes/org/eclipse/birt/report/context/ViewerAttributeBean.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/context/ViewerAttributeBean.java,v >retrieving revision 1.103 >diff -u -r1.103 ViewerAttributeBean.java >--- birt/WEB-INF/classes/org/eclipse/birt/report/context/ViewerAttributeBean.java 9 Apr 2008 10:05:50 -0000 1.103 >+++ birt/WEB-INF/classes/org/eclipse/birt/report/context/ViewerAttributeBean.java 18 Apr 2008 20:00:41 -0000 >@@ -232,7 +232,7 @@ > InputOptions options = new InputOptions( ); > options.setOption( InputOptions.OPT_REQUEST, request ); > options.setOption( InputOptions.OPT_LOCALE, locale ); >- options.setOption( InputOptions.OPT_RTL, new Boolean( rtl ) ); >+ options.setOption( InputOptions.OPT_RTL, rtl ); > > // Get parameter definition list > this.parameterDefList = getReportService( ).getParameterDefinitions( >Index: birt/WEB-INF/classes/org/eclipse/birt/report/context/BaseAttributeBean.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/context/BaseAttributeBean.java,v >retrieving revision 1.29 >diff -u -r1.29 BaseAttributeBean.java >--- birt/WEB-INF/classes/org/eclipse/birt/report/context/BaseAttributeBean.java 9 Aug 2007 05:51:36 -0000 1.29 >+++ birt/WEB-INF/classes/org/eclipse/birt/report/context/BaseAttributeBean.java 18 Apr 2008 20:00:40 -0000 >@@ -19,7 +19,9 @@ > > import javax.servlet.http.HttpServletRequest; > >+import org.eclipse.birt.report.engine.api.IReportRunnable; > import org.eclipse.birt.report.engine.api.ReportParameterConverter; >+import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants; > import org.eclipse.birt.report.service.BirtViewerReportDesignHandle; > import org.eclipse.birt.report.service.api.IViewerReportDesignHandle; > import org.eclipse.birt.report.service.api.IViewerReportService; >@@ -145,7 +147,7 @@ > * RTL option. > */ > >- protected boolean rtl = false; >+ protected Boolean rtl = null; > > /** > * determin whether the link is a toc or bookmark >@@ -233,7 +235,7 @@ > protected void init( HttpServletRequest request ) throws Exception > { > this.locale = ParameterAccessor.getLocale( request ); >- this.rtl = ParameterAccessor.isRtl( request ); >+ this.rtl = ParameterAccessor.getRtl( request ); > this.reportletId = ParameterAccessor.getReportletId( request ); > this.__init( request ); > } >@@ -249,7 +251,7 @@ > InputOptions options = new InputOptions( ); > options.setOption( InputOptions.OPT_REQUEST, request ); > options.setOption( InputOptions.OPT_LOCALE, locale ); >- options.setOption( InputOptions.OPT_RTL, new Boolean( rtl ) ); >+ options.setOption( InputOptions.OPT_RTL, rtl ); > > Collection parameterList = this.getReportService( ) > .getParameterDefinitions( reportDesignHandle, options, false ); >@@ -420,7 +422,7 @@ > */ > public boolean isRtl( ) > { >- return rtl; >+ return Boolean.TRUE.equals( rtl ); > } > > /** >@@ -584,4 +586,52 @@ > { > this.documentInUrl = documentInUrl; > } >+ >+ /** >+ * Gets the HTML/CSS equivalent of the {@link #rtl} flag. >+ * >+ * @return the {@link org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants#CSS_RTL_VALUE} >+ * or {@link org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants#CSS_LTR_VALUE} >+ * >+ * @author bidi_hcg >+ */ >+ public String getOrientation( ) >+ { >+ return Boolean.TRUE.equals( rtl ) ? CSSConstants.CSS_RTL_VALUE >+ : CSSConstants.CSS_LTR_VALUE; >+ } >+ >+ /** >+ * Updates the rtl flag based on the report design orientation. >+ * >+ * @author bidi_hcg >+ */ >+ protected void fixOrientation( HttpServletRequest request ) throws Exception >+ { >+ if ( this.rtl != null ) // already was obtained from HTTP request before >+ return; >+ >+ IViewerReportDesignHandle handle = getDesignHandle( request ); >+ if ( handle != null ) >+ { >+ Object designObject = getDesignHandle( request ).getDesignObject( ); >+ if ( designObject instanceof IReportRunnable ) >+ { >+ if ( ( (IReportRunnable) designObject ).getDesignHandle( ) >+ .isDirectionRTL( ) ) >+ { >+ this.rtl = Boolean.TRUE; >+ request.setAttribute( InputOptions.OPT_RTL, >+ Boolean.TRUE ); >+ } >+ else >+ { >+ this.rtl = Boolean.FALSE; >+ request.setAttribute( InputOptions.OPT_RTL, Boolean.FALSE ); >+ } >+ } >+ } >+ if ( this.rtl == null ) >+ request.removeAttribute( InputOptions.OPT_RTL ); >+ } > } >\ No newline at end of file >Index: birt/WEB-INF/classes/org/eclipse/birt/report/context/BirtContext.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/context/BirtContext.java,v >retrieving revision 1.3 >diff -u -r1.3 BirtContext.java >--- birt/WEB-INF/classes/org/eclipse/birt/report/context/BirtContext.java 24 May 2006 08:16:26 -0000 1.3 >+++ birt/WEB-INF/classes/org/eclipse/birt/report/context/BirtContext.java 18 Apr 2008 20:00:40 -0000 >@@ -44,5 +44,17 @@ > bean = new ViewerAttributeBean( request ); > } > request.setAttribute( IBirtConstants.ATTRIBUTE_BEAN, bean ); >+ >+ // bidi_hcg start >+ // Update the rtl flag of the bean >+ try >+ { >+ bean.fixOrientation( request ); >+ } >+ catch ( Exception e ) >+ { >+ bean.exception = e; >+ } >+ // bidi_hcg end > } > } >\ No newline at end of file >Index: birt/WEB-INF/classes/org/eclipse/birt/report/service/ReportEngineService.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/ReportEngineService.java,v >retrieving revision 1.119 >diff -u -r1.119 ReportEngineService.java >--- birt/WEB-INF/classes/org/eclipse/birt/report/service/ReportEngineService.java 16 Apr 2008 03:41:32 -0000 1.119 >+++ birt/WEB-INF/classes/org/eclipse/birt/report/service/ReportEngineService.java 18 Apr 2008 20:00:43 -0000 >@@ -60,6 +60,7 @@ > import org.eclipse.birt.report.engine.api.IExtractionResults; > import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask; > import org.eclipse.birt.report.engine.api.IHTMLRenderOption; >+import org.eclipse.birt.report.engine.api.IPDFRenderOption; > import org.eclipse.birt.report.engine.api.IRenderOption; > import org.eclipse.birt.report.engine.api.IRenderTask; > import org.eclipse.birt.report.engine.api.IReportDocument; >@@ -793,6 +794,14 @@ > { > renderOption = createPDFRenderOption( servletPath, request, > ParameterAccessor.isDesigner( ) ); >+ // bidi_hcg start >+ if ( IBirtConstants.PPT_RENDER_FORMAT.equalsIgnoreCase( format ) ) //$NON-NLS-1$ >+ { >+ // PPT doesn't require Bidi processing. >+ renderOption.setOption( IPDFRenderOption.PDF_BIDI_PROCESSING, >+ Boolean.FALSE ); >+ } >+ // bidi_hcg end > } > else > { >@@ -1162,6 +1171,15 @@ > { > renderOption = createPDFRenderOption( servletPath, request, > ParameterAccessor.isDesigner( ) ); >+ >+ // bidi_hcg start >+ if ( IBirtConstants.PPT_RENDER_FORMAT.equalsIgnoreCase( format ) ) //$NON-NLS-1$ >+ { >+ // PPT doesn't require Bidi processing. >+ renderOption.setOption( IPDFRenderOption.PDF_BIDI_PROCESSING, >+ Boolean.FALSE ); >+ } >+ // bidi_hcg end > } > else > { >Index: src/org/eclipse/birt/report/viewer/utilities/WebViewer.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.viewer/src/org/eclipse/birt/report/viewer/utilities/WebViewer.java,v >retrieving revision 1.70 >diff -u -r1.70 WebViewer.java >--- src/org/eclipse/birt/report/viewer/utilities/WebViewer.java 15 Apr 2008 03:19:57 -0000 1.70 >+++ src/org/eclipse/birt/report/viewer/utilities/WebViewer.java 18 Apr 2008 20:00:46 -0000 >@@ -341,6 +341,11 @@ > .getString( PREVIEW_MAXINMEMORYCUBESIZE ); > > // get -dir rtl option >+ // bidi_hcg: We won't derive orientation from the eclipse options, >+ // so disable this chunk of code. >+ // "__rtl" parameter will be still supported to back the scenario when >+ // is passed from outside of Designer. >+ /* > boolean rtl = false; > String eclipseCommands = System.getProperty( "eclipse.commands" ); //$NON-NLS-1$ > if ( eclipseCommands != null ) >@@ -358,7 +363,7 @@ > } > } > } >- >+ */ > if ( "true".equalsIgnoreCase( svgFlag ) ) //$NON-NLS-1$ > { > bSVGFlag = true; >@@ -412,7 +417,8 @@ > + ( LocaleTable.containsKey( locale ) > ? "&__locale=" + LocaleTable.get( locale ) : "" ) //$NON-NLS-1$ //$NON-NLS-2$ > + "&__masterpage=" + String.valueOf( bMasterPageContent ) //$NON-NLS-1$ >- + "&__rtl=" + String.valueOf( rtl ) //$NON-NLS-1$ >+ // bidi_hcg: Disable, see comment above. >+ //+ "&__rtl=" + String.valueOf( rtl ) //$NON-NLS-1$ > + ( maxrows != null && maxrows.trim( ).length( ) > 0 > ? "&__maxrows=" + maxrows : "" ) //$NON-NLS-1$ //$NON-NLS-2$ > + ( maxrowlevels != null && maxrowlevels.trim( ).length( ) > 0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Lina.Kemmel
:
review?
Actions:
View
|
Diff
Attachments on
bug 225536
:
95596
|
95598
|
96157
|
96159
|
96282
|
96299
| 96652 |
99946
|
101888
|
103603