I have followed the instructions at http://www.javacodegeeks.com/2011/01/advanced-smartgwt-tutorial-part-1.html and tried to create a simple screen that uses Smart GWT.
I have also combined this with a popup window that is basically to allow the user to sign in via Oauth- it is invoked with a single line of code from the main window of browser.
When I try to build this project in Eclipse, I am getting the following errors---
UPDATE--
Internal validation error java.lang.ArrayIndexOutOfBoundsException
ISC_DataBinding.js /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/modules line 0 JavaScript Problem
Given below is a list of errors that were occurring previously, these got eliminated by going to Project Preferences->Validation-> Disabling XML validation. (These were part of the original question- I have updated this question now that I have resolved the problems due to the below errors myself...)
Description Resource Path Location Type
Content is not allowed in prolog. DBListDS.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. DBSchema.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. DataSource.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. DataSourceField.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. DataSourceStore.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. JVMClassTreeDS.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. QuartzJobs.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. QuartzScheduler.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. QuartzTriggers.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. SchemaSet.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. SimpleType.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. Validator.ds.xml /Spark
Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. WSDLMessage.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. WSOperationHeader.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. WebService.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. WebServiceOperation.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. XSComplexType.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
Content is not allowed in prolog. XSElement.ds.xml /Spark Crawler/WebContent/com.google.api.gwt.oauth2.script.OAuth2Script/sc/schema line 1 XML
What am I doing wrong here?
Make sure you are compiling the code as a GWT application and not as a pure Java one. To do so you have two options. Either compile your app and use an external web server or run/debug your application through the embedded to Eclipse Jetty web server. For the former, just look at your toolbar and locate a blue g button. Click its arrow marker and select the GWT Compile Project option. Finally, just copy the project's war directory, after the successful compilation to the server's service directory. For the latter, right click on the project and select the Run/Debug As -> Web Application option. Then you will be provided with a link that you can copy paste in a browser and test your application.
Related
I'm trying to removing a specific line from many files I'm working on with Notepad++.
For example i've a lines:
1 file:
<mana now="110" max="110" manaGain="6" manaTicks="500" type="3"/>
2 file:
<mana now="100" max="100" manaGain="11" manaTicks="500"/>
As you can see, there are different values. I'd like to remove this string from all files. Can i do it with Notepad++, especially if each file has a different value?
You can do it by using Notepad++ and RegEx. You maybe warned - please make a backup copy of all files first.
I assume your files all have the extension *.xml and reside in folder e.g. D:\_working:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<mana now="110" max="110" manaGain="6" manaTicks="500" type="3"/>
</bookstore>
First open one of the files in your working directory by Notepad++
Ctrl+H
Go to the Find in Files tab
Find what:<mana now="[0-9]{1,}" max="[0-9]{1,}" manaGain="[0-9]{1,}" manaTicks="[0-9]{1,}".+
Replace with: NOTHING
Filters: *.xml
Directory: e.g. D:\_working
Search mode: Regular expression
Click on Replace in Files
Click on OK when you're really sure.
You may want to refine the RegEx for your needs. Short explanation:
0-9 a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
{1,} Quantifier — Matches between one and unlimited times, as many times as possible
.+ matches any character (except for line terminators)
This is resulting in:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
</bookstore>
So I am uploading a file to one drive using a resumable file upload session. However I cannot know the size of the file before uploading. I know that google allows uploading of files with content ranges like
Content-Range: 0-128/*
I would assume OneDrive would also allow it as it is even specified in RFC2616
Content-Range = "Content-Range" ":" content-range-spec
content-range-spec = byte-content-range-spec
byte-content-range-spec = bytes-unit SP
byte-range-resp-spec "/"
( instance-length | "*" )
byte-range-resp-spec = (first-byte-pos "-" last-byte-pos)
| "*"
instance-length = 1*DIGIT
The header SHOULD indicate the total length of the full
entity-body, unless this length is unknown or difficult to
determine. The asterisk "*" character means that the
instance-length is unknown at the time when the response was
generated.
But after reading the OneDrive documentation I found it says
Example: In this example, the app is uploading the first 26 bytes of a
128 byte file.
The Content-Length header specifies the size of the current request.
The Content-Range header indicates the range of bytes in the overall
file that this request represents.
The total length of the file is
known before you can upload the first fragment of the file. HTTP
Copy PUT https://sn3302.up.1drv.com/up/fe6987415ace7X4e1eF866337
Content-Length: 26 Content-Range: bytes 0-25/128
<bytes 0-25 of the file>
Important: Your app must ensure the total
file size specified in the Content-Range header is the same for all
requests. If a byte range declares a different file size, the request
will fail.
Maybe I'm just reading the documentation wrong or it only applies to this example but before I go and build a entire uploader I would just like clarification if this is allowed for OneDrive
My Question is
Does OneDrive allow uploading of files with unknown sizes?
Thanks in advance for your help
For anyone else wondering, no you can't, file uploads must specify a size.
I have a .txt file and it has FormFeed character between para1 and para 2.
Para2 needs to be shown in next page on printing hence FormFeed is placed here.
sample txt file layout:
para1
formFeedCharacter
para2
expected layout on printing:
para1 is shown in 1st page and para 2 is shown in 2nd page as formFeed acts as page break.
When opened and printed with MS Word/WordPad:
expected layout is coming in 2 pages as expected.
When opened and printed with NotePad:
1)FormFeed is not acting as Page Break and all content is printed in 1 page only
2)FormFeed is displayed as unreadable Symbol
Final Printed layout when used Notepad:
para1
Unreadable symbol (caused by FormFeed)
para2
Why Notepad is unable to render FormFeed as pageBreak ?
Is it because NotePad is a text Editor While WordPad/MS Word is Word processor ?
Is there any way how we can make this work with NotePad ?
Notepad:
1)It is a text Editor program and cannot interpret Form Feed character as Page Break.
2) Hence there is no way we can make formFeed work as page break and print it by using NotePad.
WordPad/MS Word:
1) Both are Word Processor softwares and can interpret FormFeed correctly as Page Break.
Hence Unreadable symbol is not shown on opening txt file with them
2) We can also see the page Break by Print Preview feature in wordpad/NotePad.
This hyperLink provides additional information on this topic:
Additional Info
Also below hyperlink shows similar topic post asking for a universal solution for pageBreak Feature using txt file.
page Break in txt file Universal Solution
I'm generating PDF from HTML file using utf-8 encoding. As a matter of fact, some of my titles contain non-ascii characters. In main PDF, everything is fine, encoding is right, rendering is OK.
When setting my footer.html file, I retreive the current section which does not display right whenever there is a non-ascii character in section name.
This section name is passed as a "section" URL parameter to footer.html call ; its encoding is already wrong. For example, I changed my ToC titel to the french "Table des matières" in my xsl file (that's the only change made to default xsl).
ToC page is fine in PDF, the "è" is correct. But in my footer, I retreive URI via JS which give me before unencoding : mati%C3%A8res ( when I expected it to be mati%E8res), which of course displays in my PDF footer as matières
I've found numerous pages about encoding issues in templates, main html file or header/footer html file, none of them was related to these parameters. How can I make it right in PDF ?
Sample run :
F:\test>wkhtmltopdf.exe --encoding "UTF-8" --footer-html footer.html \
--print-media-type toc --xsl-style-sheet default.xsl test.html test.pdf
Loading pages (1/6)
Counting pages (2/6)
Loading TOC (3/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
The problem was from my JS code. On parameters I used unencode() instead of using the correct function decodeURIcomponent()
I have added text file with following content to the project:
1 24 "MyApplication.manifest"
In the same folder there is also MyApplication.manifest file which is XML - this one:
C++ Builder / Delphi 2010 application manifest template
After I attempt to build resource from RC I get error - Bad character in source input(1)
Any ideas why?
RT_MANIFEST value is 24, but I am unsure what 1 is supposed to be.
I managed to find the answer myself so no answer necessary. The problem was, as usual very obscure.
Turned out that the resource script file (.RC) I was using had an UTF-8 byte order mark in the file (0xEF,0xBB,0xBF) which was invisible to the text editor but resource compiler complained about it. After removing the BOM resource compiled correctly.
I don't think many people fall into this trap but at least if anyone else sees this error in resource compiler, you should examine if there is an UTF-8 BOM in your file by viewing HEX-dump of RC file because brcc32.exe resource compiler seems to have issues with that.