Re: RichTextArea, SafeHtml, and general rich text best practices

2011-04-06 Thread nogridbag
Thank you Patrice!

I'll take a look at it.

On Apr 5, 8:58 am, Patrice De Saint Steban
patou.de.saint.ste...@gmail.com wrote:
 Hello,

 I'm doing the same thing, and I write a new Sanitize class to accept more
 tags and parameters.
 I use this sanitizer before and after the setHtml() and getHtml() of the
 RichTextArea.
 I share the file in attachment, If there are some issues thanks to inform
 me.

 Patrice

  ComplexeHtmlSanitizer.java
 15KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
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: RichTextArea, SafeHtml, and general rich text best practices

2011-04-04 Thread nogridbag
I'm really looking for a reply to this.  Surely someone must be using
GWT's RichTextArea.

On Mar 31, 1:36 pm, nogridbag nogrid...@gmail.com wrote:
 I just converted one of our simple TextArea's into a RichTextArea
 (using the RichTextToolbar from the Showcase).  I'm not quite sure I
 understand the best practices for using RichTextArea with SafeHtml.

 GWT's RichTextArea.java has the methods:

 void setHTML(SafeHtml)
 String getHTML()

 Let's say I'm writing an app which let's the user:

 1) Create new posts
 2) Edit posts
 3) Display posts
 -

 1) Create new posts

   a) First, they create a post by typing in the RichTextArea using the
 various formatting buttons available in the toolbar.

   b) This post needs to be persisted somewhere (a database or
 whatever).  Is it necessary to sanitize the user input at this
 point?  I assume it's not necessary.  So we simply call
 RichTextArea.getHTML() and persist this raw string containing
 span's, b's etc.

 2) Edit posts
   To edit the posts, we take the raw HTML the user previously entered
 that was persisted somewhere, and call
 RichTextArea.setHTML(SafeHtml).  Right?  The problem is we cannot
 generate SafeHtml that does not escape even the basic HTML outputted
 previously from the RichTextArea.  For instance, RichTextArea
 generates span's for most of the content.  SafeHtmlUtils and
 SimpleHtmlSanitizer will escape this tag.  I'm assuming using
 RichTextArea.setHTML(String) is a bad practice, so I'm looking for the
 proper way to do this.

 3) Display posts
  Displaying posts is similar to editing them, but with the added
 problem that unless they're displayed in an iframe (or another
 RichTextArea), the post will look different than what the user
 inputted (since it inherits styles from the rest of the page).

 Can someone explain the best practices for using RichTextArea?  I'm
 not really knowledgeable in this area.  I'm starting to think that web
 applications actually do not store HTML at all for posts/discussions.
 They'll use some other markup like bbcode, markdown, wikipedia style,
 etc.  If that's the case, why do all the rich text widgets (CKEditor,
 tinymce, GXT RTE, GWT RichTextArea output HTML instead of some other
 safe format?

 ... like RichTextArea.setRichText(RichText text) and
 RichTextArea.getRichText()...

 Hopefully someone can help explain this to me.

 Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
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.



RichTextArea, SafeHtml, and general rich text best practices

2011-03-31 Thread nogridbag
I just converted one of our simple TextArea's into a RichTextArea
(using the RichTextToolbar from the Showcase).  I'm not quite sure I
understand the best practices for using RichTextArea with SafeHtml.

GWT's RichTextArea.java has the methods:

void setHTML(SafeHtml)
String getHTML()

Let's say I'm writing an app which let's the user:

1) Create new posts
2) Edit posts
3) Display posts
-

1) Create new posts

  a) First, they create a post by typing in the RichTextArea using the
various formatting buttons available in the toolbar.

  b) This post needs to be persisted somewhere (a database or
whatever).  Is it necessary to sanitize the user input at this
point?  I assume it's not necessary.  So we simply call
RichTextArea.getHTML() and persist this raw string containing
span's, b's etc.

2) Edit posts
  To edit the posts, we take the raw HTML the user previously entered
that was persisted somewhere, and call
RichTextArea.setHTML(SafeHtml).  Right?  The problem is we cannot
generate SafeHtml that does not escape even the basic HTML outputted
previously from the RichTextArea.  For instance, RichTextArea
generates span's for most of the content.  SafeHtmlUtils and
SimpleHtmlSanitizer will escape this tag.  I'm assuming using
RichTextArea.setHTML(String) is a bad practice, so I'm looking for the
proper way to do this.

3) Display posts
 Displaying posts is similar to editing them, but with the added
problem that unless they're displayed in an iframe (or another
RichTextArea), the post will look different than what the user
inputted (since it inherits styles from the rest of the page).

Can someone explain the best practices for using RichTextArea?  I'm
not really knowledgeable in this area.  I'm starting to think that web
applications actually do not store HTML at all for posts/discussions.
They'll use some other markup like bbcode, markdown, wikipedia style,
etc.  If that's the case, why do all the rich text widgets (CKEditor,
tinymce, GXT RTE, GWT RichTextArea output HTML instead of some other
safe format?

... like RichTextArea.setRichText(RichText text) and
RichTextArea.getRichText()...

Hopefully someone can help explain this to me.

Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
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.



Styling CellTable with an external normal CSS stylesheet

2011-03-22 Thread nogridbag
I would like to use a normal stylesheet (that resides outside of the
source tree) to style a CellTable.

I figured out a way to do this.  But it's fairly verbose.  Is there a
better way?

My solution:
com.blah.client.Blah.java
-

@ImportedWithPrefix(blah)
interface MyPrefixedStyles extends CellTable.Style {
}

interface MyCellTableResource extends CellTable.Resources {
@Import(value = { MyPrefixedStyles.class })
@Source(junk.css)
MyPrefixedStyles cellTableStyle();
}

public void onModuleLoad() {
MyCellTableResource resource = (MyCellTableResource)
GWT.create(MyCellTableResource.class);
CellTableContact table = new CellTableContact(100, 
resource);
.
.
.
}

com/blah/client/junk.css
--
@external .blah-cellTableCell,.blah-cellTableEvenRow,.blah-
cellTableEvenRowCell,.blah-cellTableFirstColumn,.blah-
cellTableFirstColumnFooter,.blah-cellTableFirstColumnHeader,.blah-
cellTableFooter,.blah-cellTableHeader,.blah-cellTableHoveredRow,.blah-
cellTableHoveredRowCell,.blah-cellTableKeyboardSelectedCell,.blah-
cellTableKeyboardSelectedRow,.blah-
cellTableKeyboardSelectedRowCell,.blah-cellTableLastColumn,.blah-
cellTableLastColumnFooter,.blah-cellTableLastColumnHeader,.blah-
cellTableLoading,.blah-cellTableOddRow,.blah-cellTableOddRowCell,.blah-
cellTableSelectedRow,.blah-cellTableSelectedRowCell,.blah-
cellTableSortableHeader,.blah-cellTableSortedHeaderAscending,.blah-
cellTableSortedHeaderDescending,.blah-cellTableWidget;

.blah-cellTableCell{}
.blah-cellTableEvenRow{}
.blah-cellTableEvenRowCell{}
.blah-cellTableFirstColumn{}
.blah-cellTableFirstColumnFooter{}
.blah-cellTableFirstColumnHeader{}
.blah-cellTableFooter{}
.blah-cellTableHeader{}
.blah-cellTableHoveredRow{}
.blah-cellTableHoveredRowCell{}
.blah-cellTableKeyboardSelectedCell{}
.blah-cellTableKeyboardSelectedRow{}
.blah-cellTableKeyboardSelectedRowCell{}
.blah-cellTableLastColumn{}
.blah-cellTableLastColumnFooter{}
.blah-cellTableLastColumnHeader{}
.blah-cellTableLoading{}
.blah-cellTableOddRow{}
.blah-cellTableOddRowCell{}
.blah-cellTableSelectedRow{}
.blah-cellTableSelectedRowCell{}
.blah-cellTableSortableHeader{}
.blah-cellTableSortedHeaderAscending{}
.blah-cellTableSortedHeaderDescending{}
.blah-cellTableWidget{}

--
Now in my war directory I can have any stylesheet provide the styles
defined above.  OK, but having to create this junk.css is extremely
annoying.  It serves no purpose other than to prevent the CSS
selectors from being obfuscated.

There... MUST... be a better way.

I'm not using the GWT way of doing CSS for a reason.  I'm using SASS
for the website and I want Cell widgets to integrate nicely with the
rest of the SASS files.  For instance, I want to use SASS variables to
provide my Cell list/table styles.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
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.



Strange - RPC policy file randomly inconsistent between gwt compile and devmode

2011-02-23 Thread nogridbag
For a long time in our application, we've had issues running hosted
mode.  Sometimes hosted mode works, sometimes it doesn't.  We've
pretty much lived with this for months.

For instance:
1) Launch dev mode
2) Copy to Clipboard
3) Paste URL in firefox and hit enter (WORKS!)
4) Copy to Clipboard
5) Paste URL in firefox (FAILS - Status code exception)

It has nothing to do with changing source code.  We can change one
line of non-serializable code and it may take us 10 attempts for dev
mode to work.  The issue seems to be the dev mode RPC file doesn't
match the RPC file generated from a full GWT build - but it happens
RANDOMLY.

For example, here's a small portion of our GWT compile RPC file in
tomcat.  The actual RPC file is quite large: 2306 lines.
[Lcom.blah.domain.shared.SomeClass;, true, true, true, true,
[Lcom.blah.domain.shared.SomeClass;/4101108957, 4101108957

When I launch dev mode, it generates a new RPC file.  If I diff this
file with the RPC file in tomcat, only one line is different (true's
flipped to false):
[Lcom.blah.domain.shared.SomeClass;, true, true, false, false,
[Lcom.blah.domain.shared.SomeClass;/4101108957, 4101108957

If I launch dev mode again with NO CHANGES to the source code, 1 or 2
DIFFERENT lines may be differ from the original RPC file built in
tomcat.  Note: The difference is randomly in either the first two
booleans or the last two booleans.

If I launch a third time, perhaps the files will be identical (same
file name, same contents) and dev mode will work fine.  I have no idea
how to troubleshoot this.  I digged into the GWT source code,
specifically ProxyCreator.  But I don't figure out why we would see
random behavior.

Any idea how I might go about fixing this?
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
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.



Simple CellList example 2.1 M3

2010-09-24 Thread nogridbag
Are there any CellList or CellTable examples using GWT 2.1 M3?  Of the
few examples I can find, they are all out dated.  A simple hello world
example will suffice.

Looking at old examples and google IO talks, they use ListViewAdapter
which appears to be replaced with ListDataProvider.  I'm confused what
role ListDataProvider plays and how it works in conjunction with the
Cell widgets.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@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: Feedback on Large scale app development MVP article

2010-06-02 Thread nogridbag
Mainly because of habit - I always try to avoid mixing UI related code
with client/server code.  IMHO, it seems similar to doing RPC calls in
a controller or view in MVC which I think is a big no-no.

Sticking with the article example, let's say you have two places where
you want to display contacts.  The data is the same, but the views may
be completely different and thus you may want different presenters.

So now you have:
ContactsModel
ContactsPresenter
ContactsView

ContactsPresenter2
ContactsView2

You already have the RPC call to load and initialize the ContactsModel
in ContactsPresenter. Do you simply duplicate this in
ContactsPresenter2 or does ContactsPresenter2 have a dependency on
ContactsPresenter?

Anyway, I'm really just thinking out loud here ;)  I haven't sat down
and coded any thing with MVP yet.  If this is the accepted practice I
will probably do it this way too.


On Jun 2, 1:08 pm, Tristan tristan.slomin...@gmail.com wrote:
 @nogridbag

 What are your reasons for not having the presenter make RPC requests?
 The RPC Service is not a presenter itself. Probably the MVP model
 should be called MVPSE (services, event bus) because that's what it
 takes to make it really work.

 On Jun 1, 4:04 pm, jocke eriksson jock...@gmail.com wrote:

  I will answer my own question here, yes I am !! Thank god for the power of
  google.

  2010/6/1 jocke eriksson jock...@gmail.com

   Am I stupid or isn't EventBus an implementation of observer/observable.

   2010/6/1 Sripathi Krishnan sripathi.krish...@gmail.com

   There are a few things that you should keep in mind before you try to
   understand the MVP pattern

      1. You don't have reflection or observer/observable pattern on the
      client side.
      2. Views depend on DOM and GWT UI Libraries, and are difficult to
      mock/emulate in a pure java test case

   Now, to answer some of your questions

   *1. Why should model just be POJO's?*
   - Models are shared by the server and client. If models contain code to
   make RPC calls, it won't work on the server side.
   - Say the models make RPC calls and update themselves. How will the views
   know about this? Remember, there is no observer/observable pattern on the
   UI.
   - The only way multiple views can stay in sync is by listening to events.
   And events carry the model objects around, so everybody stays in sync.

   *2. You would have multiple presenters and one of them would arbitrarily
   have the RPC logic to initialize the model?*
   Have a central, command style RPC mechanism. When the data comes from the
   server, you put it on the event bus so that every view gets the updated
   data. If there is an error, you have a plug to do central error handling.
   You can also cache results centrally instead of hitting the server every
   time.

   *3. Multiple views for the same model?*
   Its actually a very common thing. Say your model is a list of contacts. 
   In
   gmail, the chat view needs this model. Also, the compose email view 
   needs it
   to auto-complete the addresses. These views cannot observe the list fof
   contacts, so the only way for them to stay in sync is via events.

   *4. Why is it a poor design decision to let the view know about this
   model?*
   Because then your views are no longer dumb. And if they are not dumb,
   you'd have to test them, which we know is difficult to do via java.

   If the view knows about the model, you will also be tempted to read from
   the text box and populate the model. At some point, you would be 
   tempted to
   add the validation in the view. And then there will be error handling. 
   And
   slowly and surely, you have reached a stage where you cannot test your 
   app
   easily.

   Which is why you want the view to only listen to low level browser events
   like clicks and key events, and then convert them to your apps vocabulary
   and then call the Presenter. Since Presenter is the only one which has 
   any
   real code, and since it does not depend on the DOM, you can test them 
   using
   only JUnit.

   *5. Event Handling*
   That part doesn't have to do with MVP, its purely a performance
   optimization. For general concepts on the subject, you may want to read 
   this
   quirks mode article http://www.quirksmode.org/js/events_order.html.

   --Sri

   On 1 June 2010 23:08, nogridbag nogrid...@gmail.com wrote:

   Hi, I've been reading the articles on MVP recently, specifically the
   articles here:

  http://code.google.com/webtoolkit/articles/mvp-architecture.html
  http://code.google.com/webtoolkit/articles/mvp-architecture-2.html

   I've primarily worked with MVC in the past so this is my first
   exposure to MVP (I've of course heard about it before but never really
   cared to learn about it in depth).

   Here's a few things that I wanted to comment on to perhaps help me
   understand this all better.

   1.  Everyone does MVC slightly differently, but I've always treated
   the model as more than

Feedback on Large scale app development MVP article

2010-06-01 Thread nogridbag
Hi, I've been reading the articles on MVP recently, specifically the
articles here:

http://code.google.com/webtoolkit/articles/mvp-architecture.html
http://code.google.com/webtoolkit/articles/mvp-architecture-2.html

I've primarily worked with MVC in the past so this is my first
exposure to MVP (I've of course heard about it before but never really
cared to learn about it in depth).

Here's a few things that I wanted to comment on to perhaps help me
understand this all better.

1.  Everyone does MVC slightly differently, but I've always treated
the model as more than a simple data object.  In MVC, I've always
designed it so that it's the model's responsibility to do RPC calls -
not the controller.

In MVP, I noticed you suggest to put this logic in the presenter.  It
seems a little strange to me.  What if you want multiple views to
essentially be an observer of the same model (I know I'm speaking in
MVC terms but you get the idea).  You would have multiple presenters
and one of them would arbitrarily have the RPC logic to initialize the
model?  I know in practice there's very few times in which you
actually need to have multiple views for the same model - so I'm OK
with this decision.  Just an observation...

2. If the model is simply a DTO as you suggest, why is it a poor
design decision to let the view know about this model?  DTO's are
simple POJOs with no logic.  True, the view will become arguably a
little smarter.  But from a maintainability standpoint I don't see why
simply moving this to a third party class, ColumnDefinition, would
make it easier to maintain.  Whenever more abstraction is added, the
code is typically much more complicated, difficult to read and
understand the flow, etc.  When I look at that ContactsViewImpl with
all the generics everywhere, I cringe a little bit.  Honestly, I don't
have much experience with unit testing UI.  So maybe in a few
sentences can you explain why having the view have a dependency on the
model (a simple pojo) will make testing more difficult?

3.  My final comment is about sinking the events.  The article states:

Reduce the event overhead by sinking events on the HTML widget,
rather than the individual cells.

In the code, I was expecting to see a single DOM.sinkEvents... but
instead it looks like each individual cell sinks events:

for row
  for col
   // TODO: Really total hack! There's gotta be a better way...
Element child = cell.getFirstChildElement();
if (child != null) {
  Event.sinkEvents(child, Event.ONFOCUS | Event.ONBLUR);
}

Is this a mistake?  Or by sinking events on the widget you mean
sinking several events on a single widget is better than sinking
events on several widgets?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@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: Feedback on Large scale app development MVP article

2010-06-01 Thread nogridbag
Thanks for your feedback Sri.

1 and 2.
In my opinion, the shared object would be DTO's - not models.  I don't
think they have to be the same.  You can have centralized RPC, but
somewhere the request is made - I don't think the RPC requests should
be done in presenter unless there will only ever be one presenter for
this model.

4. Because then your views are no longer dumb.
In this case, I would rather create a read-only immutable version of
the model instead of adding an extra layer of abstraction with
generics.  Of course the down side to this (or abstracting it with
ColumnDefinition) is that more JS code is generated.  When you have an
app as large as ours, this really becomes an issue.

On Jun 1, 2:30 pm, Sripathi Krishnan sripathi.krish...@gmail.com
wrote:
 There are a few things that you should keep in mind before you try to
 understand the MVP pattern

    1. You don't have reflection or observer/observable pattern on the client
    side.
    2. Views depend on DOM and GWT UI Libraries, and are difficult to
    mock/emulate in a pure java test case

 Now, to answer some of your questions

 *1. Why should model just be POJO's?*
 - Models are shared by the server and client. If models contain code to make
 RPC calls, it won't work on the server side.
 - Say the models make RPC calls and update themselves. How will the views
 know about this? Remember, there is no observer/observable pattern on the
 UI.
 - The only way multiple views can stay in sync is by listening to events.
 And events carry the model objects around, so everybody stays in sync.

 *2. You would have multiple presenters and one of them would arbitrarily
 have the RPC logic to initialize the model?*
 Have a central, command style RPC mechanism. When the data comes from the
 server, you put it on the event bus so that every view gets the updated
 data. If there is an error, you have a plug to do central error handling.
 You can also cache results centrally instead of hitting the server every
 time.

 *3. Multiple views for the same model?*
 Its actually a very common thing. Say your model is a list of contacts. In
 gmail, the chat view needs this model. Also, the compose email view needs it
 to auto-complete the addresses. These views cannot observe the list fof
 contacts, so the only way for them to stay in sync is via events.

 *4. Why is it a poor design decision to let the view know about this model?*
 Because then your views are no longer dumb. And if they are not dumb, you'd
 have to test them, which we know is difficult to do via java.

 If the view knows about the model, you will also be tempted to read from
 the text box and populate the model. At some point, you would be tempted to
 add the validation in the view. And then there will be error handling. And
 slowly and surely, you have reached a stage where you cannot test your app
 easily.

 Which is why you want the view to only listen to low level browser events
 like clicks and key events, and then convert them to your apps vocabulary
 and then call the Presenter. Since Presenter is the only one which has any
 real code, and since it does not depend on the DOM, you can test them using
 only JUnit.

 *5. Event Handling*
 That part doesn't have to do with MVP, its purely a performance
 optimization. For general concepts on the subject, you may want to read this
 quirks mode article http://www.quirksmode.org/js/events_order.html.

 --Sri

 On 1 June 2010 23:08, nogridbag nogrid...@gmail.com wrote:

  Hi, I've been reading the articles on MVP recently, specifically the
  articles here:

 http://code.google.com/webtoolkit/articles/mvp-architecture.html
 http://code.google.com/webtoolkit/articles/mvp-architecture-2.html

  I've primarily worked with MVC in the past so this is my first
  exposure to MVP (I've of course heard about it before but never really
  cared to learn about it in depth).

  Here's a few things that I wanted to comment on to perhaps help me
  understand this all better.

  1.  Everyone does MVC slightly differently, but I've always treated
  the model as more than a simple data object.  In MVC, I've always
  designed it so that it's the model's responsibility to do RPC calls -
  not the controller.

  In MVP, I noticed you suggest to put this logic in the presenter.  It
  seems a little strange to me.  What if you want multiple views to
  essentially be an observer of the same model (I know I'm speaking in
  MVC terms but you get the idea).  You would have multiple presenters
  and one of them would arbitrarily have the RPC logic to initialize the
  model?  I know in practice there's very few times in which you
  actually need to have multiple views for the same model - so I'm OK
  with this decision.  Just an observation...

  2. If the model is simply a DTO as you suggest, why is it a poor
  design decision to let the view know about this model?  DTO's are
  simple POJOs with no logic.  True, the view will become arguably a
  little smarter.  But from

Re: Several CSS resource questions

2010-03-22 Thread nogridbag
Thank you.  It looks like it's actually not a bug - it's a feature :)
It's a little annoying when working with legacy css file.

On Mar 19, 5:15 pm, PhilBeaudoin philippe.beaud...@gmail.com wrote:
 Just noticed that the issue has a workaround:

 filter: literal(alpha(opacity=50));

 On Mar 19, 2:14 pm, PhilBeaudoin philippe.beaud...@gmail.com wrote:

  I have the exact same problem withopacity. When I add the IE-
  specific:
    filter: alpha(opacity=20);
  TheCSSresourceto fails to compile. The IE8 version:

  seems to work fine.

  I haven't looked for a workaround, yet, but all I can think of will
  look like an ugly patch...

  I've found the bug in the issue tracker 
  at:http://code.google.com/p/google-web-toolkit/issues/detail?id=4688q=C...

  Please star it if you've had this problem too.

  On Mar 17, 1:01 pm, nogridbag nogrid...@gmail.com wrote:

   I figured out the answer to question 2.  I just had to add @NotStrict
   annotation.  Questions 1 and 3 still perplex me.

   On Mar 17, 3:45 pm, nogridbag nogrid...@gmail.com wrote:

1) @external not working as expected

The GWT doc states that if you mark a style as @external it won't be
obfuscated and it doesn't need an associated method in the CssResource
interface.

So for instance:
@external legacySelectorA, legacySelectorB;
.obfuscated .legacySelectorA {  }

When I do this, the style: .obfuscated .legacySelectorA will simply
be ignored and will not show up in the generatedCSS.  All other
styles that do not use an @external style appear fine in theCSS.

There's no errors generated.

I thought maybe I could only have one @external annotation in theCSS
file so I moved all the external styles into one big annotation at the
top of the file:

@external abc, def, ghi, blah, blahblah, blahblahblah

Putting them in one @external annotation at the top of the file
generates errors so I'm assuming this should not be done.

2) How do I simply bundle a simpleCSSfile without obfuscating it?

I thought I could simply create a CssResouce (without subclassing),
and specify an annotation so that it's just treated as a static
   resource.

Both the link (html) and stylesheet tag (in module descriptor) are
deprecated according to the documentation.  I would like slowly
transitionCSSfiles to the new CssResource method without adding 50
million @external annotations everywhere.  The styles are referenced
all throughout our project as strings like addStyleName(my-style)
and I don't want to break this functionality at the moment.

3) How can I have an = sign in a style?

@if user.agent ie6 ie8 {
        .my-style img { filter: alpha(opacity=20); } */} @elif 
user.agent gecko gecko1_8 {

        .my-style img { -moz-opacity: 0.2; }

}

The = sign in the IE specific string generates an error.

--

Finally, this isn't a question.  It's more of a general comment.  So
far the experience using the CssResource has been pretty painful.
Much of ourCSSinvolves customizing the GXT library's stylesheet.

So if you have a style like this:
.my-tab-panel-header .x-tab-strip-top .x-tab-strip-active .x-tab-right
span.x-tab-strip-text
...it quickly turns into annotation hell especially since I often have
the same external styles referenced in two spots.  Here, we're
slightly customizing the GXT tab panel adding three styles.

@external .x-tab-strip-top, .x-tab-left
.my-tab-panel-header .x-tab-strip-top .x-tab-left {
        .. oneCSSstyle

}

@external .x-tab-strip-top, .x-tab-strip-inner
.my-tab-panel-header .x-tab-strip-top .x-tab-strip-inner {
        .. one moreCSSstyle

}

�...@external .x-tab-strip-top, .x-tab-strip-active, .x-tab-strip-inner
.my-tab-panel-header .x-tab-strip-top .x-tab-strip-active .x-tab-strip-
inner {
        .. one moreCSSstyle

}

I wind up having more @external annotations all over the document than
I do actualCSScode.

Thanks.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@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.



Several CSS resource questions

2010-03-17 Thread nogridbag
1) @external not working as expected

The GWT doc states that if you mark a style as @external it won't be
obfuscated and it doesn't need an associated method in the CssResource
interface.

So for instance:
@external legacySelectorA, legacySelectorB;
.obfuscated .legacySelectorA {  }

When I do this, the style: .obfuscated .legacySelectorA will simply
be ignored and will not show up in the generated CSS.  All other
styles that do not use an @external style appear fine in the CSS.

There's no errors generated.

I thought maybe I could only have one @external annotation in the CSS
file so I moved all the external styles into one big annotation at the
top of the file:

@external abc, def, ghi, blah, blahblah, blahblahblah

Putting them in one @external annotation at the top of the file
generates errors so I'm assuming this should not be done.

2) How do I simply bundle a simple CSS file without obfuscating it?

I thought I could simply create a CssResouce (without subclassing),
and specify an annotation so that it's just treated as a static
resource.

Both the link (html) and stylesheet tag (in module descriptor) are
deprecated according to the documentation.  I would like slowly
transition CSS files to the new CssResource method without adding 50
million @external annotations everywhere.  The styles are referenced
all throughout our project as strings like addStyleName(my-style)
and I don't want to break this functionality at the moment.

3) How can I have an = sign in a style?

@if user.agent ie6 ie8 {
.my-style img { filter: alpha(opacity=20); } */
} @elif user.agent gecko gecko1_8 {
.my-style img { -moz-opacity: 0.2; }
}

The = sign in the IE specific string generates an error.

--

Finally, this isn't a question.  It's more of a general comment.  So
far the experience using the CssResource has been pretty painful.
Much of our CSS involves customizing the GXT library's stylesheet.

So if you have a style like this:
.my-tab-panel-header .x-tab-strip-top .x-tab-strip-active .x-tab-right
span.x-tab-strip-text
...it quickly turns into annotation hell especially since I often have
the same external styles referenced in two spots.  Here, we're
slightly customizing the GXT tab panel adding three styles.

@external .x-tab-strip-top, .x-tab-left
.my-tab-panel-header .x-tab-strip-top .x-tab-left {
.. one CSS style
}

@external .x-tab-strip-top, .x-tab-strip-inner
.my-tab-panel-header .x-tab-strip-top .x-tab-strip-inner {
.. one more CSS style
}

 @external .x-tab-strip-top, .x-tab-strip-active, .x-tab-strip-inner
.my-tab-panel-header .x-tab-strip-top .x-tab-strip-active .x-tab-strip-
inner {
.. one more CSS style
}

I wind up having more @external annotations all over the document than
I do actual CSS code.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@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: Several CSS resource questions

2010-03-17 Thread nogridbag
I figured out the answer to question 2.  I just had to add @NotStrict
annotation.  Questions 1 and 3 still perplex me.

On Mar 17, 3:45 pm, nogridbag nogrid...@gmail.com wrote:
 1) @external not working as expected

 The GWT doc states that if you mark a style as @external it won't be
 obfuscated and it doesn't need an associated method in the CssResource
 interface.

 So for instance:
 @external legacySelectorA, legacySelectorB;
 .obfuscated .legacySelectorA {  }

 When I do this, the style: .obfuscated .legacySelectorA will simply
 be ignored and will not show up in the generated CSS.  All other
 styles that do not use an @external style appear fine in the CSS.

 There's no errors generated.

 I thought maybe I could only have one @external annotation in the CSS
 file so I moved all the external styles into one big annotation at the
 top of the file:

 @external abc, def, ghi, blah, blahblah, blahblahblah

 Putting them in one @external annotation at the top of the file
 generates errors so I'm assuming this should not be done.

 2) How do I simply bundle a simple CSS file without obfuscating it?

 I thought I could simply create a CssResouce (without subclassing),
 and specify an annotation so that it's just treated as a static
 resource.

 Both the link (html) and stylesheet tag (in module descriptor) are
 deprecated according to the documentation.  I would like slowly
 transition CSS files to the new CssResource method without adding 50
 million @external annotations everywhere.  The styles are referenced
 all throughout our project as strings like addStyleName(my-style)
 and I don't want to break this functionality at the moment.

 3) How can I have an = sign in a style?

 @if user.agent ie6 ie8 {
         .my-style img { filter: alpha(opacity=20); } */} @elif user.agent 
 gecko gecko1_8 {

         .my-style img { -moz-opacity: 0.2; }

 }

 The = sign in the IE specific string generates an error.

 --

 Finally, this isn't a question.  It's more of a general comment.  So
 far the experience using the CssResource has been pretty painful.
 Much of our CSS involves customizing the GXT library's stylesheet.

 So if you have a style like this:
 .my-tab-panel-header .x-tab-strip-top .x-tab-strip-active .x-tab-right
 span.x-tab-strip-text
 ...it quickly turns into annotation hell especially since I often have
 the same external styles referenced in two spots.  Here, we're
 slightly customizing the GXT tab panel adding three styles.

 @external .x-tab-strip-top, .x-tab-left
 .my-tab-panel-header .x-tab-strip-top .x-tab-left {
         .. one CSS style

 }

 @external .x-tab-strip-top, .x-tab-strip-inner
 .my-tab-panel-header .x-tab-strip-top .x-tab-strip-inner {
         .. one more CSS style

 }

 �...@external .x-tab-strip-top, .x-tab-strip-active, .x-tab-strip-inner
 .my-tab-panel-header .x-tab-strip-top .x-tab-strip-active .x-tab-strip-
 inner {
         .. one more CSS style

 }

 I wind up having more @external annotations all over the document than
 I do actual CSS code.

 Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@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: Need for a great GWT GUI library

2008-12-22 Thread nogridbag

I've been using GXT (Ext-GWT) for quite some time now.  While it
certainly looks nice and provides a good amount of functionality
lacking in GWT, there are several drawbacks.

1) It is very buggy.  Bugs get fixed fairly fast, which is good, but I
find myself submitting an abnormally large amount of bugs.  While the
developer (singular) is very responsive, passionate about his work,
and friendly, the code isn't exactly up to the standards that was
hoping for.

2) It is not just a set of widgets, it's a complete framework on top
of GWT.  Your team will have to invest time to learn it.
Intermingling GWT widgets and GXT widgets is possible, but confusing
IMHO.  Which leads me to my next issue.

3) Documentation is still very lacking, although they're working on
it...

4) There's some really iffy design decisions.
a) The use of generics is not only inconsistent, but in many cases
it's not even possible to use generics due to API bugs.  The example I
was going to post was actually just fixed in the release today.
b) While the widgets look nice and performance is OK, you are forced
to back the GXT components (like Grid, Tree, List) with GXT specific
data model objects.  If you have a simple Employee POJO, and you want
to add it to a GXT Grid, you have to either wrap it in a Model or
ModelData class, or you have to implement a marker interface and do a
bit of trickery to get it in the Grid.  The only reason for all of
this is to support binding (since GWT doesn't support reflection).  I
would much rather have preferred a Swing like TableModel and an
optional binding layer on top of it.
c) The widgets look nice out of the box and customizing them slightly
with CSS is pretty easy.  However, if the changes require you to alter
the HTML of a GXT component, you're in for a world of pain.  The HTML
markup is tied heavily into the functionality of the widgets and is
referenced throughout the class either by tag name, tag id, or by css
class.  IMHO, the UI should be completely separate from the
functionality of the widgets.

5) Size.  The CSS itself is ~80k.

On the plus side, it's nice to have a pure GWT library in which I can
step into Java code (which you will have to do quite often!).  The
widgets look and function very nicely.  It would take a lot of time
and money to write many of the widgets GXT provides.  If you plan on
using it as is, it works fine.

On Dec 19, 10:13 am, Juan Backson juanback...@gmail.com wrote:
 Hi,

 I have been using GWT for almost 6 months now.  In the past six months, I
 have tried migrating code from pure GWT to GWT-EXT and then to Smart-GWT.

 They all have drawback:

 GWT - no good looking widget
 GWT-Ext - very buggy and GPL licensing
 Smart-GWT - slow and memory intensive

 Is there any library that has the same capability of Smart-GWT and good
 performance?

 Thanks,
 JB
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
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
-~--~~~~--~~--~--~---



NetBeans / hosted mode without gwt4nb

2008-10-13 Thread nogridbag

I'd like to use NetBeans for GWT development without the GWT plugin.
So I simply used applicationCreator and then I created a new NetBeans
application from existing sources.  It works fine if I use the
MyProject-comile.cmd and MyProject-shell.cmd scripts that
applicationCreator creates.  However, I'd like to setup NetBeans so
that when I hit run, it opens the hosted mode browser like eclipse
does with GWT's projectCreator.

So, I created a new run configuration within NetBeans with the
following settings:

Main Class: com.google.gwt.dev.GWTShell
Arguments: -out C:\MyProject\www com.blah.MyProject/MyProject.html

When I run the application, the hosted mode browser pops up but I
receive the following error dialog:
Failed to load module com.blah.MyProject

And the log shows the following:
[TRACE] Finding entry point classes
[ERROR] Unable to find type com.blah.client.MyProject'
[ERROR] Hint: Check that the type name 'com.blah.client.MyProject' is
really what you meant
[ERROR] Hint: Check that your classpath includes all required source
roots
[ERROR] Failure to load module 'com.blah.MyProject'

It seems to be some sort of classpath issue, but within the NetBeans
project properties the src folder is already in the Source Package
Folders list.  Any ideas?

Thanks!

P.S. The reason why I don't want to use the plugin is because it
strays away from the default GWT conventions.  Is there any reason why
the GWT devs can't add support for NB in the projectCreator utility?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: NetBeans / hosted mode without gwt4nb

2008-10-13 Thread nogridbag

Hi, thanks.  The module configuration file (and more specifically the
app entry-point) was created by the applicationCreator.  It works fine
with the MyProject-shell.cmd and MyProject-compile.cmd scripts.  It
must be some sort of NetBeans classpath option ?

On Oct 13, 7:43 pm, Fernando Paz [EMAIL PROTECTED] wrote:
 Hello.

 Not only the src must to have in the path, you need to be sure thta the
 Module.gwt.xml has the appropiatte configuration, some like this:

 entry-point
 class=ec.com.mycompany.modulos.propuesta.detalle.client.Form/

 luck!

 On Mon, Oct 13, 2008 at 6:28 PM, nogridbag [EMAIL PROTECTED] wrote:

  I'd like to use NetBeans for GWT development without the GWT plugin.
  So I simply used applicationCreator and then I created a new NetBeans
  application from existing sources.  It works fine if I use the
  MyProject-comile.cmd and MyProject-shell.cmd scripts that
  applicationCreator creates.  However, I'd like to setup NetBeans so
  that when I hit run, it opens the hosted mode browser like eclipse
  does with GWT's projectCreator.

  So, I created a new run configuration within NetBeans with the
  following settings:

  Main Class: com.google.gwt.dev.GWTShell
  Arguments: -out C:\MyProject\www com.blah.MyProject/MyProject.html

  When I run the application, the hosted mode browser pops up but I
  receive the following error dialog:
  Failed to load module com.blah.MyProject

  And the log shows the following:
  [TRACE] Finding entry point classes
  [ERROR] Unable to find type com.blah.client.MyProject'
  [ERROR] Hint: Check that the type name 'com.blah.client.MyProject' is
  really what you meant
  [ERROR] Hint: Check that your classpath includes all required source
  roots
  [ERROR] Failure to load module 'com.blah.MyProject'

  It seems to be some sort of classpath issue, but within the NetBeans
  project properties the src folder is already in the Source Package
  Folders list.  Any ideas?

  Thanks!

  P.S. The reason why I don't want to use the plugin is because it
  strays away from the default GWT conventions.  Is there any reason why
  the GWT devs can't add support for NB in the projectCreator utility?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Basic login security/session management question

2008-10-01 Thread nogridbag

Hi, I'm fairly new to web apps so I have a few basic questions about
handling the user's secure session.  I read the article on login
security here:

http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ

I understand everything up to the section How to remember logins.
At the bottom of that section it states Remember - you must never
rely on the sessionID sent to your server in the cookie header ; look
only at the sessionID that your GWT app sends explicitly in the
payload of messages to your server.

I've numbered the questions below:

1) If we can't trust cookies, what's the point of using cookies at
all?  If it's just so the browser UI thinks the user is logged in,
why not just store it in some local client side variable since GWT
applications are contained within a single page.

* Make RPC call with user/pass
* Server says pass = OK
* In User.java, call setLoggedIn(true)

2) That leads me to my next question, how should the sessionID be
stored in the client?  Do I just store it in some class, let's say
User.java as a String or whatnot in plain text?

3) Then, in any RPC request that needs the user to be logged in, I
pass this session ID along with the rest of the objects?

4) How does the server then take this sessionId and authenticate it?
Is the approach the same whether I'm using Java/RPC with Tomcat or
JSON with php on an Apache server?  Can you give an example (or a link
to a page the explains this?)

5) Finally, is there any situation where you would store the username/
pass on the client in order to authenticate each RPC call?  If so,
what would be the security implications of this?

Thanks.  I'm sorry for the basic questions.  This is all fairly new to
me since my only experience with web app security is academic and very
minimal.  It's obviously something I don't want to get wrong :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---