Pradeep

a TeamSite blog…

Connect to SQL Server from UNIX July 18, 2008

Filed under: TeamSite — Pradeep @ 6:06 pm
Tags: , , ,

If you are looking for how to connect to SQL Server from UNIX here are few simple steps to configure them

1) First Download n install the POD
2) Then you need to run this JDBC driver as init 3 service. The script is at /etc/rc3.d/S77spmf
Code of S77spmf
#!/bin/sh
#
# Start/stop processes required for SPMF
#


case “$1″ in
’start’)
/apps/iw-home/local/bin/spmf/db/start_jdbc.sh
;;
’stop’)
/apps/iw-home/local/bin/spmf/db/stop_jdbc.sh
;;
*)
echo “Usage: $0 { start | stop }”
exit 1
;;
esac
exit 0
3) Copy these jar & properties files into a separate directory and start the JDBC service as given below in the script
sqljdbc.jar
log4j-1.2.15.jar
dbd_jdbc.jar
log4j.properties
/apps/iw-home/local/bin/spmf/db/start_jdbc.sh
#!/bin/sh
CLASSPATH=/apps/iw-home/local/bin/spmf/db/dbd_jdbc.jar:/apps/iw-home/local/bin/spmf/db/log4j-1.2.15.jar:/apps/iw-home/local/bin/spmf/db:/apps/iw-home/loca
l/bin/spmf/db/sqljdbc.jar
export CLASSPATH
DRIVERS=com.microsoft.sqlserver.jdbc.SQLServerDriver
/usr/bin/java -Xms64m -Xmx512m -Djdbc.drivers=$DRIVERS -Ddbd.port=9001 com.vizdom.dbd.jdbc.Server &
JDBC_PID=$!
echo $JDBC_PID > /apps/iw-home/local/bin/spmf/db/jdbc.pid
/apps/iw-home/local/bin/spmf/db/stop_jdbc.sh
echo “Killing: `cat /apps/iw-home/local/bin/spmf/db/jdbc.pid`”
kill -9 `cat /apps/iw-home/local/bin/spmf/db/jdbc.pid`
4) Now connect to the JDBC port 9001 instead of the SQL Server port in the code
use DBI;
use DBD::JDBC;
my $dbh = DBI->connect( “dbi:JDBC:hostname=$host;port=9001;url=jdbc:sqlserver://tucgpsqlnp:1445″,”userid”,”password” ) or die print $DBI::errstr;
my $sql = “select DepartmentID from Department where DepartmentName like ‘$dept%’”;
$sth = $dbh->prepare($sql);
$sth->execute()
That’t it. Enjoy

 

Clear ComboBox in DCT July 8, 2008

Filed under: TeamSite — Pradeep @ 10:59 pm
Tags:

Since FormAPI doens’t have a method to clear the first NULL value in the dropdown, this workaround should work

var cmb = IWDatacapture.getItem(”/combo”);
var cmb_options = cmb.getOptions();
if (cmb_options != null) {
for (var i = 0; i<cmb_options.length; i++) {
cmb_options[i].selected = false;
}
cmb.setOptions(cmb_options);
}

 

Improve EventSubsystem Perfomance June 19, 2008

Filed under: TeamSite — Pradeep @ 6:12 pm
Tags:

If you don’t really use DataDeploy DAS use can comment out the following file from iw-home/httpd/webapps/eventsubsystem/WEB-INF/iw_bridge_cfg.xml

<logFile name=”TeamSiteClientDASLog”
baseLogName=”/logs/iw/iwevents/TeamSiteClientEvents”
stateFileName=”/apps/iw-home/servletd/logs/iwclientDASproxy.properties”
waitTime=”30000″
isDAS=”true” />

<logFile name=”TeamSiteDASLog”
baseLogName=”/logs/iw/iwevents/TeamsiteEvents”
stateFileName=”/apps/iw-home/servletd/logs/iwDASproxy.properties”
waitTime=”30000″
isDAS=”true” />

Pradeep

 

ssh without password November 1, 2007

Filed under: TeamSite — Pradeep @ 10:00 pm

Here is a simple how-to on setting up ssh without password

1) Client%: ssh-keygen2
2) Client%: scp id_dsa_2048_a.pub user@server:/$home/.ssh2/id_dsa_2048_a.client.pub
3) Client%: vi identification and put in this line IdKey id_dsa_2048_a

1) Server%: Login as user
2) If .ssh2 directory doesn’t exist then create one under $home/.ssh2
3) Server%: vi authorization and put in this line Key id_dsa_2048_a.client.pub

1) Client%: ssh user@Server

This should do the trick.

 

TeamSite Import Event July 16, 2007

Filed under: TeamSite — Pradeep @ 11:10 pm

If you ever want to write some TeamSite triggers on Import Event, the event to capture is not CreateFSE or Lock. It’s RenameFSE, cos TeamSite before the file isimported create a new filename in temporary location. You need to capture ARGV[6] in your script to get the actual original filename. So in brief

Register the event
iwat RenameFSE /apps/xxxxx/script.ipl

In the script capture $import_rename = $ARGV[6];

Hope this helps.

 

Preview and Generate Error June 6, 2007

Filed under: TeamSite — Pradeep @ 10:31 pm

The following error occurs when you try to preview a DCR.

Template Preview And Generate Error:

The following error occured while creating file
/.iwmnt/default/main/InternetMarketing/SystemsIntegrator/WORKAREA/Common/zz_tst_sun_lock:
No such file or directory
The templated file was not generated.

Though you the user is part of the group that owns that directory, you might repeatedly and randomly get this error. Resolution to this, navigate to the preview-dir specified in your templating.cfg and delete all .nsf* files that reside on that location. Also make sure to delete zz_tst_username_*_manifest file located under /templatedata directory.

I have been going nuts on this issue. Hope it helps.

Pradeep

 

MySQL Eventsubsystem Connection Parameters April 27, 2007

Filed under: TeamSite — Pradeep @ 9:36 pm

<DatabaseConfiguration>

<RdbmsDatabaseConfiguration

driver=”com.mysql.jdbc.Driver”
url=”jdbc:mysql://$hostname/$database_name”
user=”$username”
password=”$password”
maxActive=”10″
maxIdle=”5″
minIdleTime=”1800″
evictionInterval=”3600″ />

</DatabaseConfiguration>

 

TinyMCE Configuration March 31, 2007

Filed under: TeamSite — Pradeep @ 5:21 pm

This link will help you configure TinyMCE

http://devnet.interwoven.com/site.fcgi/techlib/56728

 

CC Url for Task Transition February 13, 2007

Filed under: TeamSite — Pradeep @ 5:21 pm

If you would want your emails to contain “Task Transition Labels” like “Accept”, “Reject”. The standard CCI Url provided by IWOV is not sufficient. Based on the CC interface you are allowing the user to transition here are the URL’s to task transition

CC Professional

http://servername/iw-cc/command/iw.ccpro.task_details_transition_task?
done%5fpage=/iw-cc/teamsite/common/refresh%5fparent%5fand%5fclose%5fwindow.html&
transition=Accept&taskid=xxxx&full_redirect=true&do_transition=true

CC Standard

http://servername/iw-cc/command/iw.ccstd.task_details_transition_task?
done%5fpage=/iw-cc/teamsite/common/refresh%5fparent%5fand%5fclose%5fwindow.html&
transition=Reject&taskid=xxxxx&full_redirect=true&do_transition=true

Hope this helps.

 

Skip Metadata Step in CC Standard February 8, 2007

Filed under: TeamSite — Pradeep @ 3:44 pm

If you want to skip tag step in CC standard add the following line to application_custom.xml

<applications>
<application id=”ccstd”>
<param id=”skip-tag-step” value=”true”>
</param>
</application>
</applications>

PS: This is a documented method available in UITK.