Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
VisualFormatter data into Database
kshitiz
Hi All,
I'm using VisualFormat tool for one of the fields of a DCR. There is a submit workflow to deploy the DCR. In the submit workflow, first the metadata is generated for the DCR, and then the metadata is deployed onto the Database table using DataDeploy. The problem is the value for the field which is having the VisualFomat is going into the database column with HTML escape sequences.
e.g. if the value entered into DCR using VisualFormat is <p>Hello</p>, the value that goes into database is <p>Hello</p>
I'm using Teamsite 5.5.2 SP 4.
Can anyone suggest some solution,
Kshitiz Sharma
BT Wholesale | CMS
Mahindra British Telecom
Find more posts tagged with
Comments
Michael
Hi
You say that only the metadata is being deployed to the database. Therefore is the VFE field being attached to your DCR as an EA? If so, perhaps the (custom) code that is doing this is converting your field to HTML entities? Can you check your EAs using the CLT?
Hope this helps
Cheers
Michael
kshitiz
Yes,
the VisualFormat field is being attached as EA. And EA has the value with HTML escape sequences only. But why it is being stored in this way? If i try to read the value of this field by using perl module TeamSite:
CRnode, the result is without escape sequences i.e < replaced with < and > replaced with > .
I'm attaching the .tpl file which is doing the metadata conversion.
The VisualFormat field referred to is:
'Alt Text' =>iwpt_dcr_value('dcr.Security.Alt Text'),
Kshitiz Sharma
BT Wholesale | CMS
Mahindra British Telecom
Michael
Hi Kshitiz
It is all custom code so I would guess it is being stored that way because the custom code is converting it somewhere - if I was you I would have a look at these functions:
setMetadataList($output, %metadata);
setDefaultMetadata(iwpt_get_dcr_name(), $output);
which are presumably in BT::IWTools;
Feel free to post them up if you want me to have a look.
Cheers
Michael
kshitiz
Hi Michael
Thanks for your support. I went through BT::IWTools and found a function:
sub xml_escape
{
my ($arg) =
@_
;
$arg =~ s/&/&/g;
$arg =~ s//>/g;
$arg =~ s/'/'/g;
$arg =~ s/"/"/g;
$arg =~ s/`/`/g;
return $arg;
}
This function is explicitly converting HTML tags into escape sequences. I can modify this to achieve the desired result.
Just one more question. If you can help me in identifying if there could be any obvious reason for this conversion. e.g. Metadata can't have HTML tags in it or something else.
Otherwise also, Thanks a lot.
Kshitiz Sharma
BT Wholesale | CMS
Mahindra British Telecom
Michael
Hi Kshitiz
No worries -- I hope it all works for you.
I haven't had any problems first hand with having things like < and > in the EAs. However I imagine quotes and double quotes could easily be a problem -- in fact there is a
recent thread
on this.
You would definitely want to include a whole bunch of 'special' characters in your testing - especially things like euro symbols, the special quotes out of Word, accented european language characters etc....
Best of luck!
Regards
Michael
kshitiz
Thanks Michael for the help
I'll experiment on this and see if there are any effects of not converting escape sequences
Kshitiz Sharma
BT Wholesale | CMS
Mahindra British Telecom