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)
iwextattr -g not getting the value from dcr
mrqp
env: solaris9/TS65SP2/Oracle9i/OD602
Hi all, I have some issues debugging a value that gets lost when creating a new Form and which gets set when you edit that same Form for a subsequent time.
The setup is the following:
datacapture.cfg
[html]
Enter details for a card image to be added.
Card Image:
Image.
Image size:
Select the size of card image.
Card Image:
Image.
Image size:
Select the size of card image.
Image :
Card Image:
Image.
Image size:
Select the size of card image.
Image :
Card Image
<script language="javascript" location="webserver" src="/iw/icp_us/debugFormAPI.js"></script>
<script language="javascript" location="webserver" src="/iw/icp_us/icp_onSaveValid_setUniqueID.js"></script>
<script language="javascript" location="webserver" src="/iw/icp_us/icp_onSaveDone_callMetaData.js"></script>
[/html]
then the js file will process the metadata tagger ui.
After adding the metadata, the worfklow is triggered and a script will generate the xml from the preview tpl.
Here is the contents of that script attached
I am really lost on why these values are not caught on a new Form.
Does anyone have experience in debugging this?
Is this a perl performance issue or an iwextattr -g stackoverflow? I saw some reference in the support website to a bug (fixed for 552) that is 26304. This says I should use iwextattr -f -u -g. That did not work for me I am afraid.
thanks
catorarn
Find more posts tagged with
Comments
mrqp
i figured out with support (thanks Tim!) that when we pipe iwextattr -g to a file, the value is actually there..:
$ /u017iwsbin001/TeamSite/bin/iwextattr -g TeamSite/Metadata/card_size /iwmnt/ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/templatedata/Generic_Content/Cards/data/GOLD_WG1_big.TheWorldGoldExclusiveCard_WG1_Big > /tmp/foobar.txt
$ view foobar.txt
"foobar.txt" [Read only] [Incomplete last line] 1 line, 3 characters
big
So, the dcr has the item 100% sure
mrqp
possibly this helps with the debugging. The log file for a new Form, the asso_files and card_size variables are not set. HOWEVER, when you edit the same form, then the 2 get set....
[html]
================= Eind Rapport ===================
================= Begin Rapport ===================
Tijd : 09-5-2007 - 15:50:48
areavpath : /ICP/main/ICS_NL/ICS_VISA/WORKAREA/content
path : /iwmnt/ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/templatedata/Generic_Content/Cards/data/GOLD_WG1_big.TheWorldGoldExclusiveCard_WG1_Big
ID : 2208240704390435
cmd: /u017iwsbin001/TeamSite/bin/iwextattr -g TeamSite/Metadata/md_brand /iwmnt/ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/templatedata/Generic_Content/Car
ds/data/GOLD_WG1_big.TheWorldGoldExclusiveCard_WG1_Big
brand : ICS-VISA
language : nl
1 - get category: GOLD_WG1
1 - get asso_files:
2 - get card_size:
Target xml: /nl/ICS-VISA/Cards/GOLD_WG1_big.xml
Del xml cmd iwdeltaskfile 167816 /nl/ICS-VISA/Cards/GOLD_WG1_big.xml delete-file
rm /iwmnt/ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/nl/ICS-VISA/Cards/GOLD_WG1_big.xml: rc del:
cmd submit: iwsubmit /ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/nl/ICS-VISA/Cards/GOLD_WG1_big.xml deleted_file
rc submit:
generate_command: iwgen -t /ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/Generic_Content/Cards/presentation/portalpage.tpl -r /ICP/main/ICS_NL/ICS_VISA/WORKA
REA/content/templatedata/Generic_Content/Cards/data/GOLD_WG1_big.TheWorldGoldExclusiveCard_WG1_Big /ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/nl/ICS-VISA/
Cards/GOLD_WG1_big.xml
XML and /nl/ICS-VISA/Cards/GOLD_WG1_big.xml set, /ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/templatedata/Generic_Content/Cards/data/GOLD_WG1_big.TheWorldG
oldExclusiveCard_WG1_Big
0 : check cmd=/u017iwsbin001/TeamSite/bin/iwextattr -g TeamSite/Metadata/id /ICP/main/ICS_NL/ICS_VISA/WORKAREA/content/nl/ICS-VISA/Cards/GOLD_WG1_big.xml.
id=2208240704390435.
set for $content_type 5: cards
[/html]
mrqp
an update on this one. I am starting to use DevNet as a blog now:
I think the if..elsif within the elsif does not work on new Forms, as I found that the category DOES get the value set when you are out of the if..elsif loop and cast this value in the $category variable:
[html]
elsif (($dcrcategory eq 'generic_content') and ($content_type eq 'cards')){
if ($card_size eq 'big') {
$category = $category."_big";
}
elsif ($card_size eq 'small') {
$category = $category."_small";
}
$content_type = 'cards';
$category = $category."_big";
print LOGFILE "category type after LOOP: $category\n";
}
[/html]
catorarn
ISCBorisB
I think the if..elsif within the elsif does not work on new Forms
You gonna be kidding...
if...elsif is one of the main language constructs. Although in theory problems of that nature are possible one would think that millions Perl users
would have spotted it before you. Anecdotal evidence that certain IWOV CLT does not output into STDOUT but does into a File is not enough to support such
extraordinary claim
mrqp
the if .. elsif loop returns results for existing dcrs, but not for new dcrs. I am not sure how to find out what that loop produces, as it returns nothing for a new dcr like this:
[html]
elsif (($dcrcategory eq 'generic_content') and ($content_type eq 'cards')){
if ($card_size eq 'big') {
$category = $category."_big";
}
elsif ($card_size eq 'small'){
$category = $category."_small";
}
$content_type = 'cards';
#$category = $category."_big";
print LOGFILE "category type after LOOP: $category\n";
[/html]
But if I uncomment $category = $category."_big";
then it does set it.
That is why I think that there is something with this functionality within the TS script context interacting with the dcr which fails.
I am not trying to bring down heaven here. I am completely confused really
nipper
I happen to agree with ICSBorisB, I would *really* be surprised if TS was able to break the if..elsif construct.
That being said, strange things can happen.
So you can continue to blog. Or, if you would like some help, I suggest you create a VERY SMALL DCT and only the JS needed as a test case to reproduce the problem (and instructions how to reproduce). Do not post everything you have, trim out everything that is not needed to reproduce the error. Support will want that if you expect them to file a bug.
mrqp
I further finding, if I change the elsif in this one:
[html]
elsif (($dcrcategory eq 'generic_content') and ($content_type eq 'cards')){
if ($card_size eq 'big') {
$category = $category."_elephant";
}
elsif ($card_size eq 'small') {
$category = $category."_mouse";
}
else{}
$content_type = 'cards';
$category = $category."_chicken";
print LOGFILE "category type after LOOP: $category\n";
[/html]
and then edit the new dcr that has nothing set on the $category variable, then I get this:
TeamSite/Metadata/category: GOLD_WG1_elephant_chicken
in the file properties of the generated xml.
It looks like for a new DCR the loop is not run or returns nothing
mrqp
I fixed this issue now. The reason for this is that the iwextattr -g got nothing for asso_files, nor card_size before iwgen is actually generating the new form into something tangible in the system. I had to place below the iwgen command in the script the following piece of code:
[html]
157 # Always fixed tpl
158 my $tpl = $thiswa.'/'.$dcrcategory.'/'.$dcrtype .'/presentation/portalpage.tpl';
159 my $generate_command = "iwgen -t $tpl -r $fulldcrvpath $targetvpath";
160 print LOGFILE "generate_command: $generate_command\n";
161 $rc = `$generate_command`;
162
163 # Get asso_files and card_size from DCR
164
165 $cmd = "$iwbin/iwextattr -g TeamSite/Metadata/asso_files ". $fulldcrpath;
166 $asso_files = (`$cmd`);
167 print LOGFILE "3 - get asso_files: $asso_files\n";
168 $cmd = "$iwbin/iwextattr -g TeamSite/Metadata/card_size ". $fulldcrpath;
169 $card_size = (`$cmd`);
170 print LOGFILE "3 - get card_size: $card_size\n";
[/html]
so it is not the loop at all, but more of my thickness as a consultant I guess.