Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Tagging config file (iw-home/local/config/datacap)
Uttara
Hi all,
I am talking about the metadata config file, which is used for 'Tagging' files. The exact file is: iw-home/local/config/datacapture.cfg
Consider the following code.
<!-- ##################### Begin BranchA Rule ##################### -->
<ruleset name="BranchA Metadata">
<view-container name="BranchA Metadata">
<view name="ViewA">
<item name="Country1">
<select required="f" >
<inline command="F:/Interwoven/TeamSite/iw-perl/bin/iwperl.exe Y:/dlrdoc/main/WORKAREA/Workarea/scripts/populateCountry1.ipl" />
</select>
</item>
</view>
</view-container>
</ruleset>
<!-- ##################### Begin BranchB Rule ##################### -->
<ruleset name="BranchB Metadata">
<view-container name="BranchB Metadata">
<view name="ViewB">
<item name="Country2">
<select required="f" >
<inline command="F:/Interwoven/TeamSite/iw-perl/bin/iwperl.exe Y:/dlrdoc/main/WORKAREA/Workarea/scripts/populateCountry2.ipl" />
</select>
</item>
</view>
</view-container>
In this case...script populateCountry2.ipl ..(for inline in BranchB) gets called even when I try to tag files in BranchA.
Is it possible to selectively call scripts for inline calls? So In our case, populateCountry2.ipl won't be called if files in BranchA are being tagged?
Find more posts tagged with
Comments
Migrateduser
You can specify which rule applies where in metadata-rules.cfg file which resides in the same folder. There should be an example file for that in the same folder.
Uttara
To be precise, I am talking about TeamSite 6.5
I have already configured metadata-rules.cfg so that specific ruleset should be applied to specific branch. But I can't see the result. Its still trying to run all rulesets for all branches.
Migrateduser
Can you show your metadata-rules.cfg?
Uttara
Here it goes:
<?xml version="1.0" encoding="UTF-8" ?>
<metadata-rules>
<cond vpath-regex="^/dlrdoc/main/BranchA">
<rule name="BranchA Metadata" />
</cond>
<cond vpath-regex="^/dlrdoc/main/BranchB">
<rule name="BranchB Metadata" />
</cond>
<cond vpath-regex=".">
<rule name="Default Rule" />
</cond>
</metadata-rules>
Will it make any difference, if BranchA and BranchB are sub-branches of BranchC?
Migrateduser
If they are both sub-branch of BranchC, then their regex should look like:
<cond vpath-regex="^/dlrdoc/main/BranchC/BranchA">
and
<cond vpath-regex="^/dlrdoc/main/BrachC/BranchB">
It's hard for me to tell whether your regex is working properly. One way for you to tell by yourself is try to use different item labels such as "Country for Branch A" and "Country for Branch B" on those items in datacapture.cfg. So when the Tagging form opens, you can see exactly which rule is being used.
Uttara
Well, I got the point about sub-branches. But in my scenario, they are not sub-branches. I was just asking a general question.
When I actually try to tag the files in BranchA, the fields I see are the once I have in ruleset for BranchA. So, thats not the issue.
Issue is, why the scripts for inline calls in other branches are being called, when I am tagging files in BranchA?
I hope you are getting my issue correctly. I do not want scripts for inline calls in *all* rulesets to be called, when I am tagging one single file in BranchA
Migrateduser
I'm assuming dlrdoc is the name of your backing store, and that's why your regex starts with ^/dlrdoc, right?
Uttara
yes, dlrdoc is the name of the backing store.
Migrateduser
How about try to use more relaxed regex:
<cond vpath-regex="^*BranchA">
Will this invoke the rule for BranchA?
Migrateduser
Sorry, typo, I meant: <cond vpath-regex="^.*BranchA">
iwovGraduate
You might want to contact support and see if this is a known bug. I have a vauge recollection of this being a bug. (I could be wrong though)
Uttara
Do you think its regex thats making the difference?
Do you think, it will solve the problem if I modify the regex?
Coz I have some more branches in my datacapture.cfg and metadata-rules.cfg. All the scripts for inlines in all of them are being called for a single file in BranchA. BranchA and BranchB are just representative names.
Adam Stoller
I believe the inlines may be getting processed before the filtering via the metadata-rules.cfg - so all the inlines would run, and then only certain fields should show up in the rendered form based upon your metadata-rules.cfg
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Uttara
Yes Fish, that is whats happening. Is it possible to stop those inlines from running, which are not being called to show up the fields?
Adam Stoller
I don't believe there is anyway to limit which inline scripts are run when the DCT is initially being processed.
However, given your description and the fact that the inlines are provided the environment variable IW_WORKAREA, you *might* be able to control the innards of the inline scripts with similar regular expressions - e.g. something like:
my $xml = qq(<?xml version="1.0" encoding="UTF-8"?> <substitution>\n);
if ($ENV{IW_WORKAREA} =~ m|/
some-regex
/|){
# code for adding complete substitution contents to $xml...
}
$xml .= "</substitution>\n";
print $xml;
The script would always run but it will produce essentially empty output when not within a branch of your choosing.
Note:
this is
un
tested - I'm not sure what IW_WORKAREA looks like in inline scripts run for metadata capture - I'm
assuming
that it will provide the actual workarea in which the file being tagged resides.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com