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)
Reading from and writing to iw.cfg
pranav
Hi,
I am trying to use
IW_cfg.pm
to read and edit
iw.cfg
file.But unbale to do so.There are many methods inside this .pm file .
I am trying
get_attr_values
to read the value of a variable from
[authentication]
section.But unable to do so .
I am attaching the perl file which is doing this activity.
Also, which method to use to write to iw.cfg.
Is there any documentation where i can find meaning of all the methods or sub modules discussed in these .pm files (e.g. usertask.pm, Wfworkflow.pm etc..)
My Env.
TS6.1 SP2 on W2K with SP4.
Regrads,
Pranav
Find more posts tagged with
Comments
Bhargav Coca
Your Attachemnt is not readable. Please check it and attach it again pleasee.
thanks
Adam Stoller
If you run perldoc on that module (on TS 6.5) - you should see the following message:
WARNING
This module is a work in progress, and will change in the next release
in non-backward-compatible ways. It is not suitable for use outside
Interwoven Engineering.
I think that message speaks for itself pretty well.
I don't seem to be able to read your attachment, so I cannot see how you are
attempting
to use it - but based on the above, you might be better off writing your own code... also, assume that if you write out a new iw.cfg you need to be 'root' (on Unix) or some privelledged user on Windows and need to consider whether or not you need to run
iwreset
at all, by itself, or with command line flags - and what affect doing so might have on other users currently using TeamSite.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Johnny
There is a CLT - iwconfig which you can use to read and write to iw.cfg
John Cuiuli
Adam Stoller
I realize the iwconfig CLT exists (and had meant to mention it) - but there still remains the issue of what to do if/when you make changes to the file.
Personally - I think you're better of version controlling all of your configuration / customization files in a separate branch and then deploying the changes to the local disk - you still have the issue of post-change-operations but you have better control of things should something go wrong.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
pranav
Sorry for the attachment !!!
I am again attaching this. Please have look.
using iwconfig is another issue. But rightnow i am trying to understand those .pm files and trying the subroutines.
Fish --- I am working on TS6.1 and this file == IW_cfg.pm is in working condition. Because its no where written in the comment that its under construction or something like this.
And this is a snippet from iw.cfg
[authentication]
authenticate_by=ldap
ldap_server=xxxxx
ldap_port=389
ldap_dnbase=ppp
ldap_key=sAMAccountName
ldap_account=cn=pranav.thakur,ou=xx,dc=yy,DC=com
ldap_pwd=password
-Pranav
Edited by pranav on 06/14/05 04:27 AM (server time).
Adam Stoller
Apparently - if the warning isn't in the 6.1 code but is in the 6.5 - then expect that what you are attempting to use will likely stop working when you next upgrade your servers ... something to keep in mind.
Anyway - you need to spend a bit more time looking at the code - at least in 6.5 it provides some examples within the code for the module - so that one would take your code:
my $pass = TeamSite::IW_cfg::get_attr_values('authentication','ldap_pwd');
print "passs $pass";
and change it to look like this:
my $cfg = TeamSite::IW_cfg->new();
$cfg->read();
my $pass = $cfg->lookup('authentication', 'ldap_pwd', 'NOT_SET');
print "passs $pass";
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
pranav
Hi fish,
I tried the code you had posted and its working perfectly fine.
I was again going through the file IW_cfg.pm and as you were right about the warning for this file. It is written at the start of the file which i couldn't see.
Sorry from my side.
One more thing !!! why are we using the third parameter i.e.
NOT_SET
thanks again for your help.
-Pranav
Adam Stoller
One more thing !!! why are we using the third parameter i.e. NOT_SET
Please either read the code (the answer is there) or don't use the module
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com