is GWT CSSResources limits css file size should not be more than 65535 bytes. why so?
This is more of a Java limitation than GWT. From java perspective the work around is splitting up the methods.
However for GWT you just need to split up your Client Bundle contents into smaller chunks.
Ideally GWT should have handled this for you by chunking up the file you are using in Client bundle. But since this is a corner case i guess you might as well log a bug. Similar Bugs list in GWT.
Also, your immediate solution would be to use alternative
1) If the text contents can be split across multiple files. Do it!!!!
2) If text contents are changing and hence cannot be split , avoid using Client Bundle.
Related
I am trying to generate a doxygen package with one enormous class hierarchy. (It's for QuickFIX, FWIW). No matter what I do, it seems to be capping the height of the image at 32766:
$ file html/inherit__graph__23.png
html/inherit__graph__23.png: PNG image data, 307 x 32766, 8-bit/color RGBA, non-interlaced
It's not clipping; it's scaling. The result is that at only 307px wide, the class boxes are scaled so small that the text inside them is not readable, and the HTML map doesn't work, either.
Neither the dot nor the doxygen documentation mention this limit, though it seems clear something is doing it, and I can't find any directives to override it. (And yes, I realize an image that big has its own problems in browsers, but I'll deal with that later.) That number seems suspicious due to its proximity to 2^15, and I believe PNG uses a 32-bit size field, so something bigger should be possible.
Anyone know where that limit is coming from and how to bypass it?
Edited to add: doxygen version = 1.6.1, graphviz = 2.26.0. Maybe too old?
Looks like I'm screwed. The 32K limit is imposed by cairo, which is what graphviz uses underneath the hood to render PNG.
Reference: http://comments.gmane.org/gmane.comp.lib.cairo/21068
Unfortunately, you're correct. It's too old; you're not going to be able to exceed that limit unless you manage to upgrade to a newer version.
I'm wondering whether it is at all possible to make the client ask the server for a given string, and incorporate it into another string ?
I don't see how to do that using the async approach.
As far as I know there is no really simple way to do this, because the i18n machanism of GWT replaces strings at compile-time and not at runtime.
You can try one of the following approaches:
Load the i18n in your entrypoint, store all messages in a local Map and create the Label etc, with the values from you cache. PRO: all GWT standard CONS: one request more, before you can show a translated page
Use JSP and no HTML at serverside. Wthin you jsp can create a JSON from your
message.properties and put it into your hostpage. PRO: You can synchronous read te values CONS: You will need to write a JSP which reads the properties for the correnct language, You will need to write a JSNI method to load the translated values.
Rethink, if you need a different way of translation. The built-in i18n will create tranlated versions of your app at compile-tim
I think I would use the second approach.
When using the HTMLWorker to covert HTML into PDF elements we can provide a StyleSheet instance that can be used to style the generated elements.
Unfortunately the CSS-to-PDF conversion is quite limited (it doesn't seem possible to indent a list for example) so I wondered if there is an equivalent iTextSharp "PDF Stylesheet" we can declare, which will be used when elements are written to the document?
Alternatively are there any events we can hook into in order to walk the element tree and apply our styles, before the document is written?
as documented on many places (especially on SO), HTMLWorker is deprecated in favor of XML Worker. XML Worker reads CSS from file, from the header, inline, etc... Read the documentation for more info about the Java version. For the C# version, take a look at the test apps.
I'm currently making good use of GWT's ClientBundles in my app. It works fine, but I have a large number of resources and it becomes tedious to manually create Java interfaces for each file:
#ClientBundle.Source("world_war_ii.txt")
public ExternalTextResource worldWarII();
#ClientBundle.Source("spain.txt")
public ExternalTextResource spain();
#ClientBundle.Source("france.txt")
public ExternalTextResource france();
I'd like to be able to (perhaps at compile time) dynamically list every *.txt file in a given directory, and then have run-time access to them, perhaps as an array ExternalTextResource[], rather than having to explicitly list them in my code. There may be hundreds of such resources, and enumerating them manually as code would be very painful and unmaintainable.
The ClientBundle documentation explicitly says that "to provide a file-system abstraction" is a non-goal, so unfortunately this seems to disallow what I'm trying to do.
What's the best way to deal with a large number of external resources that must be available at run-time? Would a generator help?
There's an automatic generator for CssResource - maybe you could look at its code and modify it to your needs?
I ended up following this advice: perform the file operations on the server, and then return a list of the file (meta)data via an RPC call.
This turns out to be fairly simple, and also allows me to return lightweight references (filenames) in the list, which I use to populate a Tree client-side; when the user clicks on a TreeItem the actual text contents are downloaded.
there are three (open) questions about the internationalization of GWT, I have:
1) Is it a (huge) performance issue, to use only "Messages" for constant and parameterized text (that's possible), where you would use both "Messages" and "Constants" usually?
2) Is there a way to specify the original text in the source code, whose translations can then be specified somewhere? (e.g. Translate("Hello") in the source code and than in a properties file for e.g. spanish: Hello = ¡Hola!)
3) Do you know any translation-tools, which generate the properties and interfaces for you?
Thanks in Advance!
1) I am not aware of any performance issues with Messages vs Constants. Since all code ends up as fairly optimized JavaScript anyway, it would seem like a minimal issue to me.
2) You can use the DefaultMessage annotation:
#DefaultMessage("Hello")
String hello();
In this case, if no corresponding translation file is found, the default message is used.
3) i18nCreator