For variables names for text components ending with a dot(.) , itextpdf appends .widget to them - itextpdf

For variable names that i am declaring using pdf expro, having dot(.) character at the end, the itext is appending "Widget" to them. IF my variable name on pdf template for a textbox is "Payment transaction no." then itextpdf makes it as "Payment Transaction No.Widget"
Why does this happen ? and suggestions about handling it, because as a part of data validation i need to pick up pdf field names and validate them with those saved in form configuration settings in the database.
Is there any other such kind of wierd possibility that might occur ? Please provide those cases.

Related

HTML2FO not working in BI Publisher to convert HTML stored in CLOB to rendered HTML in RTF

I'v using BI Publisher Desktop Template Viewer, and BI Publisher Enterprise to render HTML stored in the database as formatted HTML, and I'm not getting any output for the HTML field when using html2fo
I'm storing HTML in a CLOB field in the database.
To select into the XML I'm using something like this per Oracle's documentation:
SELECT '<![CDATA' || '['|| CLOB1 || ']' || ']>' as HTML
FROM TABLE1
I'm getting what I expect in the XML output. Field has the CDATA wrapper, and is HTML.
I've tried this in my RTF and output for that field is blank.
<?html2fo: HTML?>
I've also tried these, no difference.
<?HTML2FO: HTML?> --function in upper case
<?HTML2FO:HTML?> --no space, function in upper case
<?html2fo:HTML?> --no space, function in lower case
When I just used this, I see the raw CDATA/HTML
<?HTML?>
Any idea what I could be doing wrong here? Thanks.
There is an option/setting for CLOB fields in the data diagram, when configuring the how the data is selected. Default option is CLOB, and the other option is XML.
Different versions of BI Publisher will display this option differently. Here is from Oracle documentation, and then from the version I'm using.
If CLOB is selected, the data will be HTML escaped, and tags will change from < to <
Option 1
Keep the CLOB type, and remove the CDATA tag insertion from the select statement.
Option 2
Change to XML type, and keep the CDATA tag insertion in the select statement.

substitute space character in lua

I am creating a template in Wikipedia to link articles to an external website which is a book archive called fadedpage.com. I am generating a url to link to a specific author page. Part of the url is the author's name which contains one or more spaces. For example, the url for the author "Ian Fleming" is: http://fadedpage.com/csearch.php?author=Fleming, Ian. My template call structure is {{FadedPage|id=Fleming, Ian|name=Ian Fleming|author=yes}}.
For my template I am replicating an existing template which uses a script coded in lua to parse the template arguments. I have been able to generate all of the url except for the space character between the last and first name.
I could code the template call as: {{FadedPage|id=Fleming,%20Ian|name=Ian Fleming|author=yes}} which works OK but I would rather have the call format as it looks on the fadedpage website, ie. with the embedded space. So I need a way in lua to find the space character within the string and substitute it for the string "%20". So far I haven't figured out how to do it. Any help would be appreciated.

Why is my Rails app on Heroku soemtimes displaying apostrophes as HTML entities?

Sometimes we have jobs whose name has an apostrophe in it. I always want those apostrophes to display as ' , never as their HTML entity (').
The apostrophe displays correctly on most pages most of the time. But in some instances, the apostrophe displays as the HTML entity instead. Here's a screen-capture showing the behavior:
The apostrophes in the "Notes" field (a textarea) display correctly, but not in the "Job name" and "Display as" fields. Luckily, the apostrophes display correctly on the public-facing side, and I only see this behavior on the admin-side.
This sentence is going to sound insane, but stick with me, here: When I look at a page's source code where this problem occurs, it looks like the leading ampersand in the apostrophe's html entity is being replaced with the HTML entity for ampersand, thus becoming &#x27;
Here's a gist of the form's code.
When I look up this job's record in console, the job name and display name are "Job's Got An Apostrophe", so I know (think?) I'm not storing the HTML entity in my database. My database.yml specifies unicode encoding. It's a PostgreSQL 9.2.7 database. Not sure what other information is needed to help resolve this, if any.

Trouble encoding form data with accents

I have a basic form that asks the user to enter some text in a regular html input control and I am also using jquery-tokeninput to allow users to choose tags from a pre-filled list.
One of the tags in the pre-filled list happens to be the word café, which I have got from the server and populating the tag list by calling
mytaglist.push({id: 'café', name: 'café'});
The problem is that when they attempt to enter a word like 'café' as a tag, asp.net mvc rejects the input saying that:
A potentially dangerous Request.Form value was detected from the client (articleTags="café").
Inspection using firebug shows my post data to be something like:
UserName=neo&category=&Title=caf%C3%A9&Text=sometext&articleTags=caf%26%23233%3B&IsAgreedTerms=true
As you can see, Title has value caf%C3%A9 which is correct but articleTags has value caf%26%23233%3B which I was not expecting.
I absolutely need to make sure that café (and not some encoded value) appears on the screen.
How can I make sure that I send the correct post data and still display café everytime?
Should I change how my server sends the text?
sending the data via Html.Raw solves the problem..

Grails: User inputs formatted string, but formatting not preserved

I am just starting a very basic program in Grails (never used it before, but it seems to be very useful).
What I have so far is:
in X.groovy,
a String named parameters, with constraint of maximum length 50000 and a couple other strings and dates, etc.
in XController.groovy,
static scaffold = X;
It displays the scaffold UI (very handy!), and I can add parameter strings and the other objects associated with it.
My problem is that the parameters string is a long string with formatting that is pasted in by the user. When it is displayed on the browser, however, it does not retain any carriage returns.
What is the best way to go about this? I'm a very beginner at Grails and still have lots and lots of learning to do on this account. Thanks.
The problem is that the string is being displayed using HTML which doesn't parse \n into a new line by default. You need to wrap the text in <pre> (see: http://www.w3schools.com/tags/tag_pre.asp) or replace the \n with <br/> tags to display it correctly to the user.

Resources