Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP 1.3 and XHTML
RAP 1.3 and XHTML [message #548536] Thu, 22 July 2010 09:50 Go to next message
Philipp Eichhorn is currently offline Philipp EichhornFriend
Messages: 8
Registered: December 2009
Junior Member
Hi everyone,

A few months back, I had to port the rwt-index.html to valid XHTML. Nothing fancy really, but if anyone is interested in the patch, here it is:

### Eclipse Workspace Patch 1.0
#P org.eclipse.rap.rwt
Index: src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java,v
retrieving revision 1.4
diff -u -r1.4 DisplayUtil.java
--- src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java	29 Apr 2009 13:24:52 -0000	1.4
+++ src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java	19 May 2010 15:58:52 -0000
@@ -64,4 +64,8 @@
   public static void writeLibraries() throws IOException {
     DisplayLCAFacade.writeLibraries();
   }
+
+  public static void writeStyle() throws IOException {
+    DisplayLCAFacade.writeStyle();
+  }
 }
Index: src/org/eclipse/rwt/internal/service/RWTStartupPageConfigurer.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/service/RWTStartupPageConfigurer.java,v
retrieving revision 1.4
diff -u -r1.4 RWTStartupPageConfigurer.java
--- src/org/eclipse/rwt/internal/service/RWTStartupPageConfigurer.java	23 Mar 2010 19:11:26 -0000	1.4
+++ src/org/eclipse/rwt/internal/service/RWTStartupPageConfigurer.java	19 May 2010 15:58:52 -0000
@@ -54,6 +54,7 @@
     readContent();
     template.reset();
     template.replace( StartupPageTemplateHolder.VAR_LIBRARIES, getLibraries() );
+    template.replace( StartupPageTemplateHolder.VAR_STYLE, getStyle() );
     template.replace( StartupPageTemplateHolder.VAR_APPSCRIPT, getAppScript() );
     applyBranding();
     return template;
@@ -185,6 +186,16 @@
     }
   }
 
+  private static String getStyle() throws IOException {
+    fakeWriter();
+    try {
+      DisplayUtil.writeStyle();
+      return getContent( ContextProvider.getStateInfo().getResponseWriter() );
+    } finally {
+      restoreWriter();
+    }
+  }
+
   private static String getContent( final HtmlResponseWriter writer ) {
     StringBuffer msg = new StringBuffer();
     for( int i = 0; i < writer.getBodySize(); i ++ ) {
Index: src/org/eclipse/rwt/internal/service/StartupPageTemplateHolder.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/service/StartupPageTemplateHolder.java,v
retrieving revision 1.2
diff -u -r1.2 StartupPageTemplateHolder.java
--- src/org/eclipse/rwt/internal/service/StartupPageTemplateHolder.java	23 Mar 2010 19:11:26 -0000	1.2
+++ src/org/eclipse/rwt/internal/service/StartupPageTemplateHolder.java	19 May 2010 15:58:52 -0000
@@ -21,6 +21,7 @@
   private static final int[] EMPTY_INDICES = new int[ 0 ];
   private final static String TOKEN_BACKGROUND_IMAGE = "backgroundImage";
   private final static String TOKEN_LIBRARIES = "libraries";
+  private final static String TOKEN_STYLE = "style";
   private final static String TOKEN_APPSCRIPT = "appScript";
   private final static String TOKEN_SERVLET = "servlet";
   private final static String TOKEN_ENTRY_POINT = "entrypoint";
@@ -34,6 +35,8 @@
     = new Variable( TOKEN_BACKGROUND_IMAGE );
   public final static Variable VAR_LIBRARIES
     = new Variable( TOKEN_LIBRARIES );
+  public final static Variable VAR_STYLE
+    = new Variable( TOKEN_STYLE );
   public final static Variable VAR_APPSCRIPT
     = new Variable( TOKEN_APPSCRIPT );
   public final static Variable VAR_SERVLET
@@ -103,6 +106,7 @@
   private boolean isVariableToken( final String nextToken ) {
     return    nextToken.equals( TOKEN_BACKGROUND_IMAGE.toString() )
            || nextToken.equals( TOKEN_LIBRARIES.toString() )
+           || nextToken.equals( TOKEN_STYLE.toString() )
            || nextToken.equals( TOKEN_APPSCRIPT.toString() )
            || nextToken.equals( TOKEN_SERVLET.toString() )
            || nextToken.equals( TOKEN_ENTRY_POINT.toString() )
Index: src/org/eclipse/rwt/internal/service/rwt-index.html
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/service/rwt-index.html,v
retrieving revision 1.9
diff -u -r1.9 rwt-index.html
--- src/org/eclipse/rwt/internal/service/rwt-index.html	23 Mar 2010 19:11:26 -0000	1.9
+++ src/org/eclipse/rwt/internal/service/rwt-index.html	19 May 2010 15:58:52 -0000
@@ -1,12 +1,23 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <head>
     <title>${title}</title>
-    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
     ${headers}
+    <style type="text/css">
+	body { 
+		background-image: 
+		url('${backgroundImage}'); 
+		background-repeat: repeat; 
+	}
+	</style>
+	<!-- rap runtime style -->
+    ${style}
+    <!-- end rap runtime style -->
   </head>
 
-  <body background="${backgroundImage}">
+  <body>
 
     <noscript>
       <p style = "z-index:100000;background-color:white">
@@ -23,7 +34,8 @@
     <!-- end rap runtime javascript libraries -->
 
     <!-- validation and retrievment of startup conditions -->
-    <script type="text/javascript">
+    <script type="text/javascript" language="javascript">
+    //<![CDATA[
       function discoverAjax() {
         var result;
         if( window.ActiveXObject ) {
@@ -82,6 +94,7 @@
           + "</p>";        
         document.write( msg );
       }
+    //]]>
     </script>
   </body>
 </html>
Index: src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacade.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacade.java,v
retrieving revision 1.3
diff -u -r1.3 DisplayLCAFacade.java
--- src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacade.java	5 Dec 2008 10:57:28 -0000	1.3
+++ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacade.java	19 May 2010 15:58:52 -0000
@@ -36,6 +36,10 @@
     FACADE_IMPL.writeLibrariesInternal();
   }
 
+  public static void writeStyle() throws IOException {
+    FACADE_IMPL.writeStyleInternal();
+  }
+
   public static IDisplayLifeCycleAdapter getDisplayLCA() {
     return FACADE_IMPL.getDisplayLCAInternal();
   }
@@ -48,6 +52,7 @@
 
   abstract void writeAppScriptInternal( String id ) throws IOException;
   abstract void writeLibrariesInternal() throws IOException;
+  abstract void writeStyleInternal() throws IOException;
   abstract IDisplayLifeCycleAdapter getDisplayLCAInternal();
   abstract void writeTestWidgetIdInternal( Widget widget, String id )
     throws IOException;
#P org.eclipse.rap.rwt.q07
Index: src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java,v
retrieving revision 1.30
diff -u -r1.30 DisplayLCA.java
--- src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java	13 May 2010 12:35:55 -0000	1.30
+++ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java	19 May 2010 15:58:54 -0000
@@ -296,10 +296,13 @@
   public static void writeLibraries() throws IOException {
     QooxdooResourcesUtil.registerResources();
     ThemeManager.getInstance().registerResources();
-    writeScrollBarStyle();
     writeJSLibraries();
   }
 
+  public static void writeStyle() throws IOException {
+    writeScrollBarStyle();
+  }
+
   private static void writeJSLibraries() throws IOException {
     HtmlResponseWriter out = ContextProvider.getStateInfo().getResponseWriter();
     IResource[] resources = ResourceRegistry.get();
Index: src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacadeImpl.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacadeImpl.java,v
retrieving revision 1.3
diff -u -r1.3 DisplayLCAFacadeImpl.java
--- src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacadeImpl.java	5 Dec 2008 10:57:27 -0000	1.3
+++ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFacadeImpl.java	19 May 2010 15:58:54 -0000
@@ -33,6 +33,10 @@
     DisplayLCA.writeLibraries();
   }
 
+  void writeStyleInternal() throws IOException {
+    DisplayLCA.writeStyle();
+  }
+
   void readBounds( final Display display ) {
     DisplayLCA.readBounds( display );
   }
Re: RAP 1.3 and XHTML [message #548544 is a reply to message #548536] Thu, 22 July 2010 10:09 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi Philipp,

That's great! Would you be so kind to open a bug and attach the patch
there? Due to license issues, we can only work with patches that are
available in bugzilla.

Regards,
Ben

Philipp Eichhorn wrote:
> Hi everyone,
>
> A few months back, I had to port the rwt-index.html to valid XHTML.
> Nothing fancy really, but if anyone is interested in the patch, here it is:
>
>
> ### Eclipse Workspace Patch 1.0
> #P org.eclipse.rap.rwt
> Index: src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java
> ============================================================ =======
> RCS file:
> /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/ src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java,v
>
> retrieving revision 1.4
> diff -u -r1.4 DisplayUtil.java
> --- src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java 29 Apr
> 2009 13:24:52 -0000 1.4
> +++ src/org/eclipse/rwt/internal/lifecycle/DisplayUtil.java 19 May
> 2010 15:58:52 -0000
> @@ -64,4 +64,8 @@
> public static void writeLibraries() throws IOException {
> DisplayLCAFacade.writeLibraries();
> }
> +
> + public static void writeStyle() throws IOException {
> + DisplayLCAFacade.writeStyle();
> + }
> }
> Index: src/org/eclipse/rwt/internal/service/RWTStartupPageConfigure r.java
> ============================================================ =======
> RCS file:
> /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/ src/org/eclipse/rwt/internal/service/RWTStartupPageConfigure r.java,v
>
> retrieving revision 1.4
> diff -u -r1.4 RWTStartupPageConfigurer.java
> ---
> src/org/eclipse/rwt/internal/service/RWTStartupPageConfigure r.java 23
> Mar 2010 19:11:26 -0000 1.4
> +++
> src/org/eclipse/rwt/internal/service/RWTStartupPageConfigure r.java 19
> May 2010 15:58:52 -0000
> @@ -54,6 +54,7 @@
> readContent();
> template.reset();
> template.replace( StartupPageTemplateHolder.VAR_LIBRARIES,
> getLibraries() );
> + template.replace( StartupPageTemplateHolder.VAR_STYLE, getStyle() );
> template.replace( StartupPageTemplateHolder.VAR_APPSCRIPT,
> getAppScript() );
> applyBranding();
> return template;
> @@ -185,6 +186,16 @@
> }
> }
>
> + private static String getStyle() throws IOException {
> + fakeWriter();
> + try {
> + DisplayUtil.writeStyle();
> + return getContent(
> ContextProvider.getStateInfo().getResponseWriter() );
> + } finally {
> + restoreWriter();
> + }
> + }
> +
> private static String getContent( final HtmlResponseWriter writer ) {
> StringBuffer msg = new StringBuffer();
> for( int i = 0; i < writer.getBodySize(); i ++ ) {
> Index: src/org/eclipse/rwt/internal/service/StartupPageTemplateHold er.java
> ============================================================ =======
> RCS file:
> /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/ src/org/eclipse/rwt/internal/service/StartupPageTemplateHold er.java,v
>
> retrieving revision 1.2
> diff -u -r1.2 StartupPageTemplateHolder.java
> ---
> src/org/eclipse/rwt/internal/service/StartupPageTemplateHold er.java
> 23 Mar 2010 19:11:26 -0000 1.2
> +++
> src/org/eclipse/rwt/internal/service/StartupPageTemplateHold er.java
> 19 May 2010 15:58:52 -0000
> @@ -21,6 +21,7 @@
> private static final int[] EMPTY_INDICES = new int[ 0 ];
> private final static String TOKEN_BACKGROUND_IMAGE = "backgroundImage";
> private final static String TOKEN_LIBRARIES = "libraries";
> + private final static String TOKEN_STYLE = "style";
> private final static String TOKEN_APPSCRIPT = "appScript";
> private final static String TOKEN_SERVLET = "servlet";
> private final static String TOKEN_ENTRY_POINT = "entrypoint";
> @@ -34,6 +35,8 @@
> = new Variable( TOKEN_BACKGROUND_IMAGE );
> public final static Variable VAR_LIBRARIES
> = new Variable( TOKEN_LIBRARIES );
> + public final static Variable VAR_STYLE
> + = new Variable( TOKEN_STYLE );
> public final static Variable VAR_APPSCRIPT
> = new Variable( TOKEN_APPSCRIPT );
> public final static Variable VAR_SERVLET
> @@ -103,6 +106,7 @@
> private boolean isVariableToken( final String nextToken ) {
> return nextToken.equals( TOKEN_BACKGROUND_IMAGE.toString() )
> || nextToken.equals( TOKEN_LIBRARIES.toString() )
> + || nextToken.equals( TOKEN_STYLE.toString() )
> || nextToken.equals( TOKEN_APPSCRIPT.toString() )
> || nextToken.equals( TOKEN_SERVLET.toString() )
> || nextToken.equals( TOKEN_ENTRY_POINT.toString() )
> Index: src/org/eclipse/rwt/internal/service/rwt-index.html
> ============================================================ =======
> RCS file:
> /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/ src/org/eclipse/rwt/internal/service/rwt-index.html,v
>
> retrieving revision 1.9
> diff -u -r1.9 rwt-index.html
> --- src/org/eclipse/rwt/internal/service/rwt-index.html 23 Mar 2010
> 19:11:26 -0000 1.9
> +++ src/org/eclipse/rwt/internal/service/rwt-index.html 19 May 2010
> 15:58:52 -0000
> @@ -1,12 +1,23 @@
> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> -<html>
> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> <head>
> <title>${title}</title>
> - <meta http-equiv="content-type" content="text/html; charset=UTF-8">
> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
> ${headers}
> + <style type="text/css">
> + body { + background-image: +
> url('${backgroundImage}'); + background-repeat: repeat; + }
> + </style>
> + <!-- rap runtime style -->
> + ${style}
> + <!-- end rap runtime style -->
> </head>
>
> - <body background="${backgroundImage}">
> + <body>
>
> <noscript>
> <p style = "z-index:100000;background-color:white">
> @@ -23,7 +34,8 @@
> <!-- end rap runtime javascript libraries -->
>
> <!-- validation and retrievment of startup conditions -->
> - <script type="text/javascript">
> + <script type="text/javascript" language="javascript">
> + //<![CDATA[
> function discoverAjax() {
> var result;
> if( window.ActiveXObject ) {
> @@ -82,6 +94,7 @@
> + "</p>"; document.write( msg );
> }
> + //]]>
> </script>
> </body>
> </html>
> Index:
> src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFa cade.java
> ============================================================ =======
> RCS file:
> /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFa cade.java,v
>
> retrieving revision 1.3
> diff -u -r1.3 DisplayLCAFacade.java
> ---
> src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFa cade.java
> 5 Dec 2008 10:57:28 -0000 1.3
> +++
> src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFa cade.java
> 19 May 2010 15:58:52 -0000
> @@ -36,6 +36,10 @@
> FACADE_IMPL.writeLibrariesInternal();
> }
>
> + public static void writeStyle() throws IOException {
> + FACADE_IMPL.writeStyleInternal();
> + }
> +
> public static IDisplayLifeCycleAdapter getDisplayLCA() {
> return FACADE_IMPL.getDisplayLCAInternal();
> }
> @@ -48,6 +52,7 @@
>
> abstract void writeAppScriptInternal( String id ) throws IOException;
> abstract void writeLibrariesInternal() throws IOException;
> + abstract void writeStyleInternal() throws IOException;
> abstract IDisplayLifeCycleAdapter getDisplayLCAInternal();
> abstract void writeTestWidgetIdInternal( Widget widget, String id )
> throws IOException;
> #P org.eclipse.rap.rwt.q07
> Index: src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.j ava
> ============================================================ =======
> RCS file:
> /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt. q07/src/org/eclipse/swt/internal/widgets/displaykit/DisplayL CA.java,v
>
> retrieving revision 1.30
> diff -u -r1.30 DisplayLCA.java
> --- src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.j ava
> 13 May 2010 12:35:55 -0000 1.30
> +++ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.j ava
> 19 May 2010 15:58:54 -0000
> @@ -296,10 +296,13 @@
> public static void writeLibraries() throws IOException {
> QooxdooResourcesUtil.registerResources();
> ThemeManager.getInstance().registerResources();
> - writeScrollBarStyle();
> writeJSLibraries();
> }
>
> + public static void writeStyle() throws IOException {
> + writeScrollBarStyle();
> + }
> +
> private static void writeJSLibraries() throws IOException {
> HtmlResponseWriter out =
> ContextProvider.getStateInfo().getResponseWriter();
> IResource[] resources = ResourceRegistry.get();
> Index:
> src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFa cadeImpl.java
> ============================================================ =======
> RCS file:
> /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt. q07/src/org/eclipse/swt/internal/widgets/displaykit/DisplayL CAFacadeImpl.java,v
>
> retrieving revision 1.3
> diff -u -r1.3 DisplayLCAFacadeImpl.java
> ---
> src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFa cadeImpl.java
> 5 Dec 2008 10:57:27 -0000 1.3
> +++
> src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCAFa cadeImpl.java
> 19 May 2010 15:58:54 -0000
> @@ -33,6 +33,10 @@
> DisplayLCA.writeLibraries();
> }
>
> + void writeStyleInternal() throws IOException {
> + DisplayLCA.writeStyle();
> + }
> +
> void readBounds( final Display display ) {
> DisplayLCA.readBounds( display );
> }
>


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: RAP 1.3 and XHTML [message #548547 is a reply to message #548544] Thu, 22 July 2010 10:24 Go to previous message
Philipp Eichhorn is currently offline Philipp EichhornFriend
Messages: 8
Registered: December 2009
Junior Member
Continuing here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=320607
Previous Topic:Global session timeout
Next Topic:Browser caching and org.eclipse.equinox.http.registry.resources
Goto Forum:
  


Current Time: Fri Apr 26 08:13:32 GMT 2024

Powered by FUDForum. Page generated in 0.03516 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top