Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to insert static HTML content
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
compuroad  
View profile  
 More options Nov 2, 10:17 pm
From: compuroad <wilson.ferreira...@gmail.com>
Date: Mon, 2 Nov 2009 19:17:18 -0800 (PST)
Local: Mon, Nov 2 2009 10:17 pm
Subject: How to insert static HTML content
I would like to know if there is a built in way in GWT to read and
inject HTML content. At least 50% of the site I am planning has static
HTML content that would not benefit from GWT one page model. I am
thinking in building a application that reads the static content using
java.io.File and injects into GWT using the HTML widget.

I would like to know if there are any alternatives.

Thanks,

Wilson


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rjcarr  
View profile  
 More options Nov 3, 2:53 am
From: rjcarr <rjc...@gmail.com>
Date: Mon, 2 Nov 2009 23:53:31 -0800 (PST)
Local: Tues, Nov 3 2009 2:53 am
Subject: Re: How to insert static HTML content
I would suggest writing your page in the traditional way and then only
filling in GWT for the sections you need.  You typically do with
placeholders as divs and tds.  For example:

<body>
  Here is some HTML ...
  <div id="gwt"></div>
  Here is more HTML ...
</body>

...

EntryPoint {
  RootPanel.get("gwt").add(new Label("Here is GWT HTML ..."));
  ...

}

On Nov 2, 7:17 pm, compuroad <wilson.ferreira...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
compuroad  
View profile  
 More options Nov 3, 11:42 pm
From: compuroad <wilson.ferreira...@gmail.com>
Date: Tue, 3 Nov 2009 20:42:09 -0800 (PST)
Local: Tues, Nov 3 2009 11:42 pm
Subject: Re: How to insert static HTML content
Thanks for the sugestion. But what do I do with "navigation". GWT is a
"one page" show. When the user needs to create an account on the site
I need to clear the "Home" content and replace with a GWT generated
"Create Account" page/content. But since my home is static HTML, how
am I going to do it?

On Nov 3, 3:53 am, rjcarr <rjc...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert J. Carr  
View profile  
 More options Nov 4, 12:35 am
From: "Robert J. Carr" <rjc...@gmail.com>
Date: Tue, 3 Nov 2009 21:35:25 -0800
Local: Wed, Nov 4 2009 12:35 am
Subject: Re: How to insert static HTML content
Well, what you say here:

"GWT is a "one page" show"

Is absolutely true.  Given that, you'll have to come up with the
solution that suits you best.  Some options are:

 1) Don't use GWT for the login and have it redirect you to your GWT
page when you've authenticated.
 2) Integrate your login into GWT and have it replace the login with
content when you've authenticated.
 3) Create 2 GWT apps, one for login and one for content.

There are probably other options I'm missing ...


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gwtfanb0y  
View profile  
 More options Nov 4, 5:04 am
From: gwtfanb0y <siegfried.b...@googlemail.com>
Date: Wed, 4 Nov 2009 02:04:01 -0800 (PST)
Local: Wed, Nov 4 2009 5:04 am
Subject: Re: How to insert static HTML content
I would recommend to integrate the login into the GWT page. This works
very great
for me (collected good experience with it) and is easy to implement.
So everything
looks smooth.

On 4 Nov., 06:35, "Robert J. Carr" <rjc...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bambury  
View profile  
 More options Nov 4, 7:09 am
From: Ian Bambury <ianbamb...@gmail.com>
Date: Wed, 4 Nov 2009 12:09:27 +0000
Local: Wed, Nov 4 2009 7:09 am
Subject: Re: How to insert static HTML content

What I do is create a complete html file for each page. This allows my site
to get spidered, allows updates without recompiles, easier to write than
Java strings, etc. In the GWT app, I just use requestbuilder to get the page
directly, strip out the content, and put it in an HTMLPanel (so I can get at
the elements by id)

There's no need for any server-side code to get and return the html.

Ian

http://examples.roughian.com

2009/11/3 compuroad <wilson.ferreira...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yozons Support on Gmail  
View profile  
 More options Nov 4, 12:39 pm
From: Yozons Support on Gmail <yoz...@gmail.com>
Date: Wed, 4 Nov 2009 09:39:56 -0800
Local: Wed, Nov 4 2009 12:39 pm
Subject: Re: How to insert static HTML content

On Wed, Nov 4, 2009 at 2:04 AM, gwtfanb0y <siegfried.b...@googlemail.com>wrote:

> I would recommend to integrate the login into the GWT page. This works
> very great
> for me (collected good experience with it) and is easy to implement.
> So everything looks smooth.

Siegfried, what is the mechanism to start with a login page view, then
switch to the application view once authenticated, but still using the same
base HTML page?

How do you swap out the login page layout and put in the new one?  And
presumably if your RPC shows they are no longer logged in, it can then
revert back and display the login page view again.

Is there a way to create these as separate modules (new to all of this) and
then have them swap in/out?  And it seems like there would be more issues
for memory leaks and such doing this as you'd certainly need to be sure to
clear out all objects in the other views as they change.

I know it's possible as I've seen in in gmail, switching from inbox to
contacts, etc., but not clear how to make it work.  Any code examples we can
study?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gwtfanb0y  
View profile  
 More options Nov 5, 3:30 am
From: gwtfanb0y <siegfried.b...@googlemail.com>
Date: Thu, 5 Nov 2009 00:30:56 -0800 (PST)
Local: Thurs, Nov 5 2009 3:30 am
Subject: Re: How to insert static HTML content
In the following code snippet i am using GIN and GUICE with the MVP
Pattern. In my module, i am loading
the class 'AppPresenter':

*** MainApp.java ***
public void onModuleLoad() {
    AppPresenter appPresenter = injector.getAppPresenter();
    appPresenter.go(RootPanel.get());
    injector.getPlaceManager().fireCurrentPlace();

}

Now follow to the method "go", you can see that the "container" is
currently null. The method "checkIsUserInSession()"
decides what to show. I am using Spring Security in the backend to
check user permissions and return a UserModel
with a simple boolean inside it (for this example i have modified it
to make it simple). The methods "showMain()" and
"showLogin()" are adding only components to the container. That's it.

*** AppPresenter.java ***
import com.google.gwt.user.client.ui.HasWidgets;

public class AppPresenter {
    private HasWidgets container;

}

public void go(final HasWidgets container) {
    this.container = container;
    checkIsUserInSession();

}

@SuppressWarnings({"NonBooleanMethodNameMayNotStartWithQuestion"})
private void checkIsUserInSession() {
  UserServiceAsync rpcService = GWT.create(UserService.class);
  rpcService.getCurrentUser(new FailureCheckingAsyncCallback<UserModel>
() {
    @Override
    protected void doOnSuccess(UserModel result) {

      //noinspection unchecked
      if (result.isLoggedIn==true)
        showMain();
      } else {
        showLogin();
      }
    }
  }
  );

}

@SuppressWarnings({"MethodOnlyUsedFromInnerClass"})
private void showMain() {
  container.clear();
  container.add(portalMainWidget.getDisplay().asWidget());

}

private void showLogin() {
  container.clear();
  container.add(loginComponent.getDisplay().asWidget());

}

Have a lot of fun!

On 4 Nov., 18:39, Yozons Support on Gmail <yoz...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yozons Support on Gmail  
View profile  
 More options Nov 5, 8:00 pm
From: Yozons Support on Gmail <yoz...@gmail.com>
Date: Thu, 5 Nov 2009 17:00:58 -0800
Local: Thurs, Nov 5 2009 8:00 pm
Subject: Re: How to insert static HTML content

Thanks.

On Thu, Nov 5, 2009 at 12:30 AM, gwtfanb0y <siegfried.b...@googlemail.com>wrote:

> @SuppressWarnings({"MethodOnlyUsedFromInnerClass"})
> private void showMain() {
>  container.clear();
>  container.add(portalMainWidget.getDisplay().asWidget());
> }

> private void showLogin() {
>  container.clear();
>  container.add(loginComponent.getDisplay().asWidget());
> }

What type are the loginComponent and portalMainWidget?

David


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yozons Support on Gmail  
View profile  
 More options Nov 6, 1:58 pm
From: Yozons Support on Gmail <yoz...@gmail.com>
Date: Fri, 6 Nov 2009 10:58:14 -0800
Local: Fri, Nov 6 2009 1:58 pm
Subject: Re: How to insert static HTML content

Decided to send this directly to your email in case you missed it in the
google groups.  I think your framework makes sense to me, except I'm not
sure what super type (implemenst/extends) the components that you swap in
and out are.  They seem to have a getDisplay() method that itself has an
asWidget() method, so not sure what I'd do with my current separate pages.

Of course, my current login page and my current main app page are all
objects that implement EntryPoint.  So I see I'll have a much smaller
EntryPoint class in the new model, and its job will be to swap in the other
two (and possible a few others as we grow, like a distinct logoff view,
reset passwords, etc.) based on whether its logged in or not.  But when I
move most of the code in my existing classes that implement EntryPoint,
presumably they should subclass/implement something in common so that the
new EntryPoint class can do the swaps (and use getDisplay().asWidget()...).

Thanks for any insights...

On Thu, Nov 5, 2009 at 5:00 PM, Yozons Support on Gmail <yoz...@gmail.com>wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gwtfanb0y  
View profile  
 More options Nov 9, 5:46 am
From: gwtfanb0y <siegfried.b...@googlemail.com>
Date: Mon, 9 Nov 2009 02:46:06 -0800 (PST)
Local: Mon, Nov 9 2009 5:46 am
Subject: Re: How to insert static HTML content
They extend 'com.google.gwt.user.client.ui.Composite'.

"getDisplay().asWidget())" is a method (in use with the MVP) which
returns only the Widget:

  @Override
  public Widget asWidget() {
      return this;
  }

I do not separate my views into different EntryPoints, just use them
inside one EntryPoint
and switch them on/off with my AppPresenter.class .

On 6 Nov., 02:00, Yozons Support on Gmail <yoz...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yozons Support on Gmail  
View profile  
 More options Nov 9, 8:06 pm
From: Yozons Support on Gmail <yoz...@gmail.com>
Date: Mon, 9 Nov 2009 17:06:49 -0800
Local: Mon, Nov 9 2009 8:06 pm
Subject: Re: How to insert static HTML content

On Mon, Nov 9, 2009 at 2:46 AM, gwtfanb0y <siegfried.b...@googlemail.com>wrote:

> They extend 'com.google.gwt.user.client.ui.Composite'.

> "getDisplay().asWidget())" is a method (in use with the MVP) which
> returns only the Widget:

>  @Override
>  public Widget asWidget() {
>      return this;
>  }

Thanks for the answer.  I don't know what getDisplay() does or where it's
defined, but I figured I didn't really need it.  I think I am now doing more
or less the same as you, but my "page view objects" just return their
topmost panel which is set into the app presenter's RootPanel, which in my
case also does the EntryPoint.  It seems to work great.

I suppose there's no time benefit to downloading of the application page
views (I think there's some code splitting that may help in the now or in
the future with 2.0), but it does snap nicely between views.

Thanks again...


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gwtfanb0y  
View profile  
 More options Nov 10, 5:14 am
From: gwtfanb0y <siegfried.b...@googlemail.com>
Date: Tue, 10 Nov 2009 02:14:07 -0800 (PST)
Local: Tues, Nov 10 2009 5:14 am
Subject: Re: How to insert static HTML content
You are right, "getDisplay" is only an Interface and was not useful
for this example.
So you have moved from many to only one EntryPoint?

With code splitting in GWT 2.0 i think it is possible to show the user
a "loading in progress"-view,
like the same when your browser opens a big flash page.

On 10 Nov., 02:06, Yozons Support on Gmail <yoz...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yozons Support on Gmail  
View profile  
 More options Nov 10, 8:52 pm
From: Yozons Support on Gmail <yoz...@gmail.com>
Date: Tue, 10 Nov 2009 17:52:23 -0800
Local: Tues, Nov 10 2009 8:52 pm
Subject: Re: How to insert static HTML content

Yes, I only have one EntryPoint now and it does look nicer and is
snappier.   I'll worry about code splitting later, I suppose.  Right now,
it's fine that everything is downloaded together.  Hopefully it won't be too
big a deal to partition it once that feature is available.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google