Re: Create ImageResource from URL derived from DB?

2013-12-15 Thread Benjamin Possolo
This is not what ImageResource was designed for. ImageResource is part of 
ClientBundle and is intended for bundling images into a single sprite map 
to reduce the number of network requests between the user's browser and 
your server. The artifacts are generated at compile time.

If you want to define the background image of your GWT Button widget (which 
is just a  or  element), use the DOM api and CSS to set the 
background to the desired image url.

String urlToImage = "http://www.foo.com/your-image.png";;
Button b = new Button();
b.getElement().getStyle().setProperty("background", "url('" + urlToImage + 
"') no-repeat");

Here is a stackoverflow post that talks about setting background images on 
input elements
http://stackoverflow.com/questions/2738920/background-image-for-input-type-button


On Saturday, December 7, 2013 9:18:06 AM UTC-8, Nolan Brassard wrote:
>
> Is there a way to create an ImageResource from a URL?
>
> I have a scenario where I'd like to allow the user to give me a URL to an 
> image that will then be used as the Icon of a certain button later on. The 
> only way I know how to create an ImageResource is via a client bundle and 
> setting @Source. Is there another way to do this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: GWT.create conference - call for presentations

2013-07-06 Thread Benjamin Possolo
Hey Joonas,

I currently live in San Diego but am considering a relocation to San 
Francisco so either way, it should be possible for me to attend the 
conference in SF.
I built this website http://markteplace.styleguise.net entirely in core GWT 
(running on GAE + java) and I use a lot of the "fancier" GWT features 
extensively.
If you are interested, I could probably give a presentation on a lot of the 
best practices I use within my application.
Here are some example topics:


   - Making a GWT application Google crawl-able (using #! notation, 
   Activities/Places and HtmlUnit).
   - Best practices when using UiBinder (, , anchors with 
   SafeUris, html templates, HTMLPanel, preferring native html elements over 
   widgets, nesting ui:binder based widgets)
   - Using the Editor Framework with UiBinder, jsr303 and field decorators 
   for rendering validation errors.
   - Introducing split points into an app that uses Activites/Places using 
   AsyncProxy and viewing the build artifacts using SOYC.
   - Stylizing CellTables with CSS, custom Cells, html templates
   - Embedding javascript libraries like Google Analytics, jquery and 
   jquery plugins like CuteTime, fancybox, qtip (and maybe managing script 
   injection at runtime).

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.




Re: I/O 2013 - GWT Sessions?

2013-05-19 Thread Benjamin Possolo
I think a GWT conference would be great as well.
It would probably make more sense to occur somewhere on the west coast 
though since it is much closer to silicon valley.

The San Diego Convention Center is always a great place for conventions.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: The app is not loading in Safari?

2013-05-02 Thread Benjamin Possolo
Try completely deleting the safari browser cache, cookies, history, etc. then 
verify you have all the latest safari updates. 

I'm guessing u have some deferred binding issue as well but if not, the above 
may kickstart the browser. 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: GWT dev plugin for Chrome 21.0.1180.60 m not installing

2013-02-07 Thread Benjamin Possolo
First off, what a nightmare it is just to get the plugin working on chrome.
the chrome store kept failing to install the plugin with a worthless error 
message.
So i defaulted back to my old habit of opening the chrome extensions tab 
and then dragging the CRX file directly onto the browser.
But that was failing now too due to a "incorrect magic number" error.
I finally figured out i need to be logged into my google account in order 
to install the plugin directly from the google chrome store.
Why doesn't the plugin install screen just say "you must be logged in to 
install the plugin" rather than the worthless message it does now??

On Tuesday, October 2, 2012 11:12:04 AM UTC-7, Chris Calabro wrote:
>
> that is bizarre.  it did not work last night even with many attempts, but 
> the exact same operation this morning worked!
> i didn't even restart chrome or anything.  btw i'm using chrome Version 
> 22.0.1229.64 beta.
>
> - chris
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Ultimate GWT + GAE + Datanucleus + Eclipse + Maven Guide

2013-01-12 Thread Benjamin Possolo
Awesome! The archetype is a great idea!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/3WD1o_VWBOoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Ultimate GWT + GAE + Datanucleus + Eclipse + Maven Guide

2013-01-10 Thread Benjamin Possolo
Thank you! It took me quite a while.

Does your project have a similar setup?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/mBjcQcdru1AJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: ByteBuffer to String

2013-01-07 Thread Benjamin Possolo
ByteBuffer is not supported in GWT client code as documented here
https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation#Package_java_io
so you should re-evaluate whatever you are doing with those first.

I dont know if that google library you are using for the charsets class 
works gwt client code either.
i would guess not.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/QfjVAFz9pXoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT application runtime memory size is too large (client side)

2013-01-07 Thread Benjamin Possolo
+1 to this
code splitting will be the biggest improvement you can make. if you are 
using activities/places then it is easy to introduce split points around 
every activity (using AsyncProxy).

If your UiBinder templates are innefficiently written then it will impact 
memory a lot. prefer using HTMLPanel at the top of most uibinder views and 
then use raw html as often as possible instead of gwt widgets.

also when gwt compiling, make sure you are producing obfuscated javascript 
rather than pretty or detailed

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/BVxbeElth9gJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to center an Image?

2013-01-07 Thread Benjamin Possolo
an  element is, by default, an inline element (as opposed to a block 
element).
That means you can simply use the following css property to center it:

.myImage {

text-align: center;

}







the image will be centered within the simple panel.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/xwzpsyw6HQoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Ultimate GWT + GAE + Datanucleus + Eclipse + Maven Guide

2013-01-07 Thread Benjamin Possolo
Hey all,

I wrote this guide on setting up a project that uses GAE, GWT, Datanucleus, 
Eclipse and Maven.
It is a case study of a complicated project and should be useful to those 
of you wishing to move to a Maven-based build system.

http://bpossolo.blogspot.com/2013/01/the-ultimate-guide-to-gwt-gae-maven.html

Benjamin

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/_UD2VBmwUH8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: how to add meta tag in the header's page [with uibinder ?]

2012-12-31 Thread Benjamin Possolo
Here is an example for setting the description meta element

public static void setMetaDescription(String description){

 NodeList nodes = Document.get().getElementsByTagName("meta");

 for( int i = 0; i < nodes.getLength(); i++ ){

MetaElement meta = (MetaElement)nodes.getItem(i);

if( "description".equals(meta.getName()) ){

meta.setContent(description);

break;

}

}

}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/gH8DbwD85tcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: execute priority ServletContextEvent handler and static block

2012-12-31 Thread Benjamin Possolo
do not put code in a static block in your servlet context listener.
the context initialized method is guaranteed to be called exactly once for 
a servlet context listener before any of your servlets are initialized

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/VdaSfaAVqZoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Crawlable (SEO)

2012-12-31 Thread Benjamin Possolo
Jan

you seem to be kind of trolling; duplicate thread created 5 days ago by 
yourself and you clearly didnt bother to use the search feature but I will 
answer anyways

Just copy the filter I wrote:
https://groups.google.com/forum/#!topic/google-web-toolkit/aBt-QCCQkKY

On Thursday, December 27, 2012 3:36:17 AM UTC-8, Jan wrote:
>
> Hi
>
> I like to make my GWT-App by the google bot. I found this article (
> https://developers.google.com/webmasters/ajax-crawling/). It states there 
> should be a servlet filter, that serves a different view to the google bot. 
> But how can this work? If i use for example the activities and places 
> pattern, than the page changes are on the client-side only and there is no 
> servlet involved -> servlet filter does not work here.
>
> Can someone give me an explanation? Or is there another good tutorial 
> tailored to gwt how to do this?
>
> Thanks and best regards
> Jan
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/VqqvW4u0QmUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: rpc serialization without the rpc

2012-11-02 Thread Benjamin Possolo
Correct me if I am wrong but it sounds like your idea will only have one 
advantage over a traditional caching layer on the server: avoiding 
serialization costs. You will still have deserialization costs which are 
likely a lot more time consuming since they happen in javascript in the 
browser versus in the JVM on the server.

I think what you are suggesting is dangerously bordering along the lines of 
"ghetto."
I feel like caching on the client (using a Command like design pattern and 
local storage) plus a normal caching layer on the server will vastly 
outweigh the benefits and hassle of creating and maintaining an 
GWT-RPC-HTTP frankenstein.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/X1X0L3B0JLEJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Cross field validation on client

2012-10-31 Thread Benjamin Possolo
I am not familiar with the GWT Validation framework.
I'm not really sure why people use it considering vanilla GWT supports 
JSR303 (the documentation is pretty bad admittedly).

Using plain GWT you would have a class-level validation annotation:

@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)@Constraint(validatedBy
 = PasswordsEqualValidator.class)@Documentedpublic @interface PasswordsEqual {  
  String DEFAULT_MESSAGE = "Passwords must be the same";
String message() default DEFAULT_MESSAGE;Class[] groups() 
default {};Class[] payload() default {};}


Then you would need a custom validator. Mine looks like this:


public class PasswordsEqualValidator implements 
ConstraintValidator {@Override   
 public void initialize(PasswordsEqual constraintAnnotation) {}
@Overridepublic boolean isValid(CreateAccountBean value, 
ConstraintValidatorContext context) {if( value 
== null )return true;
String password = value.getPassword();String confirmPassword = 
value.getConfirmPassword();if( password == null 
&& confirmPassword == null )return true;
if( password != null && password.equals(confirmPassword) )  
  return true;return false; 
   }}


Then annotate the javabean class being validated with @PasswordsEqual


This works on the client and server.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/X7QzUe1UblcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Destroy a widget

2012-10-31 Thread Benjamin Possolo
I can't really understand what you are asking or saying.

If you want the widget to remain visible but to stop receiving events, do 
what Jens said: suppress the event handling logic in the event handler.
If you want the widget to stop being visible and to stop receiving events, 
just do what I said: remove the widget from it's container.

and yes, javascript also has garbage collection otherwise every web 
application would be one giant memory leak

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/zfufHmcP2kgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: how to pass a String[] array in the declarative UI

2012-10-31 Thread Benjamin Possolo
You are trying to add logic to your UiBinder XML file which is not what it 
is intended to do. View-specific logic goes in the java code.

Just do it in the constructor or if you are caching your views (which is 
good for performance) in a dedicated method that can be called before the 
view is rendered by your Activity.

For the sake of an example, lets assume your UiBinder class is called 
MyView.

public class MyView extends Composite {

//definition of UiBinder interface and instance

@UiField
FinishButton finish;

public MyView(){

initWidget(binder.initAndBindUi(this));

}


public MyView(Rights permissions){

this();

updateUi(permissions);

}

 

public void updateUi(Rights permissions){

if( permissions == FINISH_ORDER || permissions == CANCEL_ORDER ) 

finish.setVisible(true);

}

@UiHandler("finish")
void onClickFinish(ClickEvent e){

//handle the click

}

}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/3M-vQeFosXAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: ListDataProvider.addDataDisplay() and setRowData

2012-10-29 Thread Benjamin Possolo
ListDataProvider wraps a list collection. It allows you to modify the 
wrapped collection and to automatically propagate those changes to the UI.

If you do not use the ListDataProvider (and just call setRowData()) 
directly, then you will need to call setRowData() whenever you make changes 
to your list.

So basically, if you intend on modifying the list (adding/deleting) after 
it is rendered, use the ListDataProvider.
If you are just setting the list data to show it, then just use setRowData()

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/R5kHsRt4vQgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT vs SmartGWT

2012-10-29 Thread Benjamin Possolo
I recommend straight GWT for almost everything. The other frameworks just 
add abstractions on top of GWT that confuse things a lot more.

Designing screens: UI Binder
Client-side validation: Editor framework + JSR303 validation using 
HibernateValidator 4.0.2GA
Performance: AsyncProxy, ClientBundle, stick to concrete collections in 
data transfer objects, etc
Communicate with server over WSDL: you are kind of fucked on this one. I 
don't know why you would want your javascript to talk WSDL with a server. 
While I appreciate SOAP/WSDL, that is just way too much overhead for your 
javascript client to deal with. Your server's WSDL layer likely uses some 
sort of business interface written in Java. Create a new backend endpoint 
using REST or for even easier GWT-integration using GWT-RPC. This endpoint 
should just reuse the same business interface that your WSDL endpoint uses.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/LewlhrMuFccJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Destroy a widget

2012-10-29 Thread Benjamin Possolo
Sorry there is a typo there.

GWT.getRoot().add(panel);
should be
RootPanel.get().add(panel);

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/U6PTh3qWnIkJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Destroy a widget

2012-10-29 Thread Benjamin Possolo
I presume by uibinder owner you mean your HelloWorld class overrides the 
onEvent() method, is that correct?

I also presume that you have some other component that is using the 
HelloWorld objects and attaching them to the view.
For example, in your EntryPoint:

HelloWorld h1 = new HelloWorld();
HelloWorld h2 = new HelloWorld();

FlowPanel panel = new FlowPanel();
panel.add(h1);
panel.add(h2);

GWT.getRoot().add(panel);

If you want to "destroy" h1, and have it stop reacting to events, simply 
remove it from the dom and ensure it is garbage collected (ie. set your 
reference to null):

panel.remove(h1);
h1 = null;

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/o6TIayyZhVIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: caching background image

2012-10-29 Thread Benjamin Possolo
If you can, use a ClientBundle. That will ensure the background image only 
gets downloaded once with the rest of your image resources and the 
spritemap produced by the client bundle should be cached by the browsers.

create an interface called AppImages that extends ClientBundle (class must 
be in part of your apps 'client' and visible to the gwt compiler).

public interface AppImages extends ClientBundle {

@Source("background.png")

ImageResource background();

}


put the PNG in your source folder alongside the AppImages interface.

ideally you would do this for all small-to-moderate sized image resources that 
your app uses.


When you want to set the background image of an element, you have several ways 
of doing it (note: i'm writing this without actually testing so it may not be 
perfect).


1) Use an HTML template to create the element with the background image


public interface HtmlTemplates extends SafeHtmlTemplates {

@Template("")

SafeHtml backgroundDiv(SafeUri imageUrl);

}


HtmlTemplates templates = GWT.create(HtmlTemplates.class);

AppImages images = GWT.create(AppImages.class);


SafeUri backgroundImage = images.background().getSafeUri();

SafeHtml backgroundDiv = templates.backgroundDiv(backgroundImage);


2) Set the background-image css property on the element that underlies the GWT 
widget.


AppImages images = GWT.create(AppImages.class);

SafeUri backgroundImage = images.background().getSafeUri();


FlowPanel panel = new FlowPanel(); //this creates a div

panel.getElement().getStyle().setBackgroundImage(backgroundImage.asString());



Remember, you'll probably also want to set the other important css properties 
like background-repeat, background-position, etc.

Finally, if you want the image to be available publicly on the web, use the 
 declaration in your GWT module descriptor. This will tell the compiler 
to dump the background PNG into your war//background.png folder so 
you can access it out on the web like 
www.yourdomain.biz/yourmodule/background.png

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/ktSjQdQcEO4J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Can't get Google Crawler to index my GWT-based site no matter what I do. Help!

2012-10-29 Thread Benjamin Possolo
It looks like that may have done the trick. I am not 100% certain if it was 
that because my app engine log files are showing a ton of traffic from the 
google bot yesterday at night. either way, thanks for finding that major 
mistake.

googling "site:marketplace.styleguise.net" is now finally showing entries!!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/j3JsQRP_9A0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Can't get Google Crawler to index my GWT-based site no matter what I do. Help!

2012-10-29 Thread Benjamin Possolo
On Monday, October 29, 2012 4:28:11 AM UTC-7, Gonzalo Ferreyra Jofré wrote:

> Hello,
> the hashbang is inverted (!#) in your URLs in the xml. Should be this way 
> #!
> Try switching the position of the hash
>
 
Oh wow! big mistake on my behalf. thank you for catching that!!
i wonder if that will do the trick. google always plays down the importance 
of sitemaps.
I'm fixing, uploading, resubmitting and ill report back

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/F6-vcYd6gVAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Can't get Google Crawler to index my GWT-based site no matter what I do. Help!

2012-10-28 Thread Benjamin Possolo
On Sunday, October 28, 2012 7:28:05 AM UTC-7, ant...@gmail.com wrote:

> Your URLs could be further improved if you go through the proposal in 
> http://carlosaguayo.posterous.com/html5-history-in-gwt
>
> Was i in your position, i would do the above and then generate a 
> sitemap.xml for search engine submittion
> Antonios [dot] Chalkiopoulos [at] keepitcloud [dot] com
>

I forgot to add, I already have a sitemap which I submitted to the 
Webmaster Tools. It's really short...only 15 URLs. Doesn't seem to help at 
all though.
http://marketplace.styleguise.net/sitemap.xml 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/lOA2QLYOMl8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Can't get Google Crawler to index my GWT-based site no matter what I do. Help!

2012-10-28 Thread Benjamin Possolo
On Sunday, October 28, 2012 7:28:05 AM UTC-7, ant...@gmail.com wrote:

> Your URLs could be further improved if you go through the proposal in 
> http://carlosaguayo.posterous.com/html5-history-in-gwt
> Was i in your position, i would do the above and then generate a 
> sitemap.xml for search engine submittion
> Antonios [dot] Chalkiopoulos [at] keepitcloud [dot] com
>

Thank you for taking the time to respond.

I presume you are suggesting I get rid of the hash-bang entirely from my 
URLs. I didn't know that was possible yet (apparently the HTML5 History API 
permits this; thanks for pointing that out to me). However, by doing that, 
Google would no longer consider my site an "ajax site". I am following the 
ajax crawlability guidelines they document 
here.
 
So when they send the special query parameter (_escaped_fragment_) my 
server knows that it should generate and return an HTML snapshot of 
whatever page/gwt-place is being crawled.

If I removed the hash-bang, google would no longer send the 
_escaped_fragment_ query parameter with their crawl requests and it would 
be near-impossible for me to know when I should generate a snapshot versus 
just returning the normal content.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/UDUOXYl7L1QJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Can't get Google Crawler to index my GWT-based site no matter what I do. Help!

2012-10-28 Thread Benjamin Possolo
On Sunday, October 28, 2012 8:50:27 AM UTC-7, Joseph Lust wrote:

> I see you're using places and the url tokens, are you using GWTP? There is 
> some built in crawler support there that you could use, or at least 
> investigate if you're not using GWTP.
>
> http://code.google.com/p/gwt-platform/wiki/CrawlerSupport
>
> SIncerely,
> Joseph
>

Thanks for responding!

Yes you are correct. I am using places and activities (but not GWTP). I use 
straight GWT throughout the entire app (including all the editor + 
validation stuff).

GWTP does include a canned filter for handling crawlability. I have a very 
similar one albeit slightly optimized.

/**
 * Special filter that adds support for Google crawling as outlined here 
 * ({@link 
https://developers.google.com/webmasters/ajax-crawling/docs/getting-started}
 * 
 * @author Benjamin Possolo
 */
public class GoogleCrawlerFilter implements Filter {
 private static final Logger log = 
Logger.getLogger(GoogleCrawlerFilter.class.getName());

private static final ThreadLocal webClient = new 
ThreadLocal(){
@Override
protected WebClient initialValue() {
log.info("Instantiating headless browser");
WebClient wc = new WebClient(BrowserVersion.FIREFOX_3_6);
wc.setThrowExceptionOnScriptError(false);
wc.setThrowExceptionOnFailingStatusCode(false);
wc.setCssEnabled(false);
return wc;
};
};
 @Override
public void init(FilterConfig config) throws ServletException {}
 @Override
public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
throws IOException, ServletException {
 HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse resp = (HttpServletResponse)response;
String queryString = req.getQueryString();
 if( queryString != null && queryString.contains("_escaped_fragment_") ){
 log.info("Detected request from Google Crawler");
 //google requests the URL with the place fragment as a query parameter.
//they do this because URL fragments (the portion after the hash #) are
//not sent with an HTTP request.
//convert the ugly URL to the real url that uses the hashbang
queryString = queryString.replaceFirst("&?_escaped_fragment_=", "#!");
queryString = URLDecoder.decode(queryString, "UTF-8");
 StringBuilder pageToCrawlSb = new 
StringBuilder(req.getScheme()).append("://").append(req.getServerName());
if( req.getServerPort() > 0 )
pageToCrawlSb.append(':').append(req.getServerPort());
pageToCrawlSb.append(req.getRequestURI());
if( ! queryString.startsWith("#!") )
pageToCrawlSb.append('?');
pageToCrawlSb.append(queryString);
 String pageToCrawl = pageToCrawlSb.toString();
log.log(Level.INFO, "Page being crawled: {0}", pageToCrawl);
 //check if a snapshot of the requested page already exists
String htmlSnapshot = MemcacheUtil.getHtmlSnapshot(pageToCrawl);
if( htmlSnapshot == null ){
try{
//use HtmlUnit to render the requested page
long start = System.currentTimeMillis();
log.info("Using headless browser to fetch page");
HtmlPage page = webClient.get().getPage(pageToCrawl);
log.info("Pumping javascript event loop for 8 seconds");
webClient.get().getJavaScriptEngine().pumpEventLoop(8000); //execute 
javascript for 8 seconds
long end = System.currentTimeMillis();
log.log(Level.INFO, "Time to generate page snapshot: {0} seconds", ((end - 
start) / 1000L));
 //we add a special message to the top of the page so that anyone seeing 
the snapshot will
//know it is meant for Google crawling
String snapshotMsg = new StringBuilder("\n\n")
.append("\n")
.append("\n")
.append("  \n")
.append("You are viewing a non-interactive page that is intended for 
the crawler.\n")
.append("You probably want to see this page: " + pageToCrawl + "\n")
.append("  \n")
.append("\n")
.append("\n")
.toString();
htmlSnapshot = page.asXml();
htmlSnapshot = htmlSnapshot.replaceFirst("]*>", snapshotMsg);
 //store the rendered page in memcache
MemcacheUtil.putHtmlSnapshot(pageToCrawl, htmlSnapshot);
}
finally{
webClient.get().closeAllWindows();
}
}
 //send the html snapshot back to the crawler
resp.setContentType("text/html; charset=UTF-8");
PrintWriter writer = resp.getWriter();
writer.print(htmlSnapshot);
}
else{
chain.doFilter(request, response);
}
}

@Override
public void destroy() {
//this is never called on Google App Engine
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/00Zmn6IfmrgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Can't get Google Crawler to index my GWT-based site no matter what I do. Help!

2012-10-27 Thread Benjamin Possolo


I am unable to get my GWT-based site to be indexed by Google no matter what 
I do.

My URLs all look like this:

http://marketplace.styleguise.net/#!/home
http://marketplace.styleguise.net/#!/new-listings
http://marketplace.styleguise.net/#!/item/172001
http://marketplace.styleguise.net/#!/about

and so on.

I have a URL servlet handler that properly returns static HTML snapshots of 
my site (using HtmlUnit) when they are requested as:

http://marketplace.styleguise.net/?_escaped_fragment_=/home
http://marketplace.styleguise.net/?_escaped_fragment_=/new-listings
http://marketplace.styleguise.net/?_escaped_fragment_=/item/172001
http://marketplace.styleguise.net/?_escaped_fragment_=/about

My host HTML page has the special meta tag:



Finally, I have a sitemap with about 15 URLs. One of them is the host page, 
the rest are all hash-bang based URLs.

Within the Webmaster Tools, Google is reporting only one page as having 
been indexed (the home page without a hash-bang). I've tried submitting my 
URLs individually using the Fetch As Googlebot tool but that seems to 
disallow one from submitting hash-bang URLs to the index, even if they 
fetch properly and the preview is correct. I've tried both with and without 
a robots.txt file as well. Nothing works!

This is driving me mad! Has anyone managed to get Google to index their GWT 
site? If so, I would REALLY appreciate any advice.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/CWL6DtYRa8AJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to make ValueBoxEditorDecorator error message positionate to the right?

2012-10-27 Thread Benjamin Possolo


Add a style name to your decorator div element. i call mine "textBoxDecorator" 
then use the following css selectors:

.textBoxDecorator div:first-child {
float: right;
}
.textBoxDecorator div:last-child {
float: left;
}

.textBoxDecorator::after {

content: "";

display: block;

clear: both;

}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/RqTp7xle9BoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Dev Plugin broke (Chrome/mac osx)

2012-10-15 Thread Benjamin Possolo
Reverting to Chrome 21 worked for me but the fact that Google Chrome 
auto-updates means I always have to use this browser and I can never quit 
the browser either.
This is so stupid. Google, please allow users to easily disable auto-update 
for christ's sake. Its ridiculous that we always have to auto-update all 
Google products or none. This has bitten me so many times at work too.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/sIaBAvZJch0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.