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)
Unique ID in DCT
Rohit
I need to assign a unique ID to a DCT. I tried the inline command using perl (inline command=".../iwperl.exe .../autogenerate_pageid.ipl") but for some reason the text box shows up empty in the DCT. I tried calling the ipl file from the command prompt and it works fine but for some reason the dct doesn't show the value. Any thoughts on why this isn't working? Also is there another way to uniquely identify a DCT?
Find more posts tagged with
Comments
Adam Stoller
Well - if you don't show us your inline script - and you don't show us the context in which it is being called within your DCT - it's kind of hard for us to tell you why it might not be working.
I believe a number of people use inline scripts with DB callouts to retrieve a unique identifier from a DB process (that automatically increments) - although similar things can be done with a flat-file too - but you have to be a bit more aware of file locking and such.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Rohit
Thanks for the reply. Here are more specifics:
<item name="it_page_id">
<label>PageID</label>
<description>PAGEID ID Autogenerated</description>
<inline command=".../iwperl.exe .../autogenerate_pageid.ipl"/>"/>
<database data-type="VARCHAR(300)"/>
</item>
And the code in the ipl is simply:
$pageid = some random number
print <<EOF;
<?xml version='1.0' encoding='UTF-8'?>
<substitution>
<text required="f">
<default>$pageid</default>
</text>
</substitution>
EOF
Rohit
Actually I found the error. My inline command had an extra "/> at the end of the line. Not sure why I didn't get an error but all is well now. Thanks for your time.
chuckles
Don't all files in IW get a unique ID for free? I think you can access it with "iwattrib
vpath
objid".
iwovGraduate
... Don't all files in IW get a unique ID for free? I think you can access it with "iwattrib vpath objid". ...
Use of objectids other than internal purpose was never supported. There is no gurantee that the way object ids are created and used will be remain the same in future versions of TeamSite. You might want to think again before using something that might break on upgrade.
See these threads for more discussion on this:
TeamSite objid
container ID ?
PS: Nothing is for free. You paid for the license didn't you ?
Edited by iwovGraduate on 02/15/05 03:26 PM (server time).
gzevin
I wrote a CGI callout that, on the first run set a unique ID, on subsequent clicks it will just display it.
as to how you impement a uniquenss - it could vary. I had to do it with a plain text file as there were some rules that a database could not handle - however calling a simple sequencer from a database could do a trick in most other cases
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU