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)
adding a counter
System
Hello:
Just wanted to pose this question to the community, as I wasn't finding anything too quickly either by searching on the support or Devnet sites. However that might due to not using the proper terms in my query.
I been asked to add some type of numerical counter to datacapture.cfg file. When the user opens a new form the next number in sequence will be added to a read-only field in the form. There are a number of ways this could be done but I was hoping someone would be willing to advise the best way to implement.
thanks as always for your attention
christine
Find more posts tagged with
Comments
iwovGraduate
What version of TeamSite ? SP/Patch level ?
iwovGraduate
This has been discussed numerous times. You should be able to find quiet a few posts about this.
... There are a number of ways this could be done ...
Can you share which ways have you considered so far ? Perhaps its something thats better than anybody has ever done before. No pun intended - others can benefit from it.
... someone would be willing to advise the best way to implement ...
The best way would depend on the details of your requirement and your environment. e.g. do you have any restrictions on the sequence ? gaps in sequence would make a difference ?
The obvious way is to use an inline in your DCT to populate a field. The inline could get the next number in sequence from a text file or a DB. You can also use FormAPI. There could be other approaches depnding on how/when/where the counter/ID is used. Each approach has its own pros/cons.
jbonifaci
Whatever way you implement, make sure that it is not possible for your number grabber to grab the same number if two processes are spawned simultaneously. Having a unique identifier that isn't unique can cause problems,
.
gzevin
I've implemented a CGI callout that implements just that. it acquires a lock that prevents reuse of identifiers. I had to resort to a file to keep the number, because the composition of the number was such, that a database sequancer would not be suitable. However, if the number itself is not important, one could implement a call to a DB. DB has got its own locking mechanism, so there is no need to worry about it.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
dataset.zip
saumil
Hi,
We have implemented similiar kind of functionality.
We are assigning numeric ID on save event of dcr.
On save event you can call to ipl that will do following steps.
get lock of file if lock is available else wait.
fetch counter.
process it and get next one.
apply to dcr.
persist back to file.
release lock.
Saumil
BTWholesale | CMS
Mahindra British Telecom
Migrateduser
Sorry - forgot ...
Our Platform:
Solaris 8
TeamSite version 6.1 SP 1
Open & Data Deploy 6.0
Migrateduser
Hi -
Our current process is as follows.
We use a perl script to pull the next Oracle sequence number from the database when the form loads for the first time. The goal was to use the next sequence number to prevent duplicate articles from being sent to the db after an edit. Currently for this deployment process it works great.
(in the datacapture)
<!--added to pull oracle id from db-->
<item name="ArticleId">
<label>Article Id</label>
<inline command="/obase/tools/perl/bin/perl /iw-home/TeamSite/local/bin/audience_lookup_test.ipl"/>
</item>
The new requirement from our business - technical team is that the content be copied from branch A. to branch B and sent to another database. The technical issue, is in moving content from db to db is the Oracle line id. Simply coping the content and sending it will not generate a new sequence number in the next database.
We are exploring the idea of using a counter in TeamSite instead of pulling the Oracle id. But to be honest I'm not convinced changing this process is a good idea.
I'm not a DBA and don't know a great deal about Oracle, but am working to learn more every day. I don't know if adding a line number in TeamSite will work in the same manner as pulling the next Oracle sequence, preventing duplicate files from being sent.
Our DBA would to see us do something like this:
Select article, file_id from table; ---> on originating database"dev"
pass article and file_id into script below
select count(*) from table where file_id = file_id from query above. --> on database to update"uat"
if file_id exists
then
update table with article where file_id = file_id from query above
else
get next value from sequence for unique line_id
insert into table line_id, file_id, article
This decision on this has not been formally determined, we thought if testing with a TeamSite embedded counter, written in PERL or using FormAPI could occur. We would be better able to find our solution.
Thanks for reading -
- christine