gui_doc
TRANSCRIPT
Web Interface Architecture of ArcMentor (GUI)
Introduction
ArcMentor is an instant message monitoring system that enables the Administrator to monitor the messages and chat sessions sent by various chat clients to the server.
Technologies JSP, Servlet, HTML, XML,JDBC
Database MySQL/MsSQL
Database Name ims
Architecture MVC (Model View Controller)
IM’s Corporate IM: 1. Sun Microsystem’s sun one IM 2. IBM’s SameTime3. Microsoft’s MSN LCS4. Open Source Jabber IM5. Public IM
a. Yahoob. MSNc. AIMd. Gadu Gadue. ICQf. Google Talk
6. Buddy Stream
Editor NetBeans
Platform for ArcMentor Windows ,Linux, Solaris
Web Server Tomcat/ Sun One Web Server
Libraries used Java Tag libraries, Log4j,MySqlJConnector,Base64
Arcmentor.ini
Path: Windows - > C:/Arcmentor/Arcmentor.ini Linux -> /usr/Arcmentor/Arcmentor.ini
Arcmentro.ini file is required for database connection.
Basic Contents of Arcmentor.ini file are:PrimaryDatabaseServerIP=192.168.0.113PrimaryDatabaseRootUser=rootPrimaryDatabaseRootUserPassword=SMTPServerIP=SecondaryDatabaseServerIP=192.168.0.112 SecondaryDatabaseRootUser=root SecondaryDatabaseRootUserPassword=ClusterSystemPassword=arcmentor
Note: there will be some difference in Arcmentor.ini for different IM’s.
Architecture:
When user types URL =http://IP-Address:Port number/Arcmentor in web browser (e.g.: http://192.168.0.113:8080/Arcmentor) the request goes to the Web Server which gets data from the database and send response back to the web browser.
By Default ports:
Tomcat web Server : 8080 NetBeans : 8084
Web Browser: The ArcMentor GUI is best viewed on Internet Explorer 6.0
Requirements:
IM Types JAVA Web Database Operating
Web ServerWeb
BrowserDB
Server SystemsSun Microsystem’s sun one IM 6.1/7
j2sdk1.4.1, 1.5.1
Sun One Web Server/ Apache Tomcat 5.0 ,5.5
MySQL 4.0,MySQL4.1,MySQL5.0
SameTime 2.5,3.0,6.5.1,7.0
j2sdk1.4.1, 1.5.1
Apache Tomcat 5.0 ,5.5
MySQL 4.0,MySQL4.1,MySQL5.0
PIM j2sdk1.4.1, 1.5.1
Apache Tomcat 5.0 ,5.5
MySQL 4.0,MySQL4.1,MySQL5.0
BuddyStream j2sdk1.4.1, 1.5.1
Apache Tomcat 5.0 ,5.5
MySQL 4.0,MySQL4.1,MySQL5.0
MSN LCS 2003/2005 SP1
j2sdk1.4.1, 1.5.1
Apache Tomcat 5.0 ,5.5
MySQL 4.0, MySQL4.1,MySQL5.0. /MsSQL Server 2000
Database:
Name: ims
arc_messages Messages after archiving stored in this tableaudit_details Details of the Audited Sessions
backup_restore Describe last backup datecluss_pass Clustering Password cluster_sys_info Describes Primary ad Secondary database detailsemail_admin Contains Email ID’s to send mailemail_user Contains Email ID’s of users to send mailexclude_list List of users whose sessions are not to be log exclude_messages Details of Sessions of those users who are in exclude listims_monitor Not in use ims_table_info Not in useimscheck Not in use ip_table Not in use keywords Contains Keywords on which need to send Keyword Notificationldap_config Not in use messages Contains Details of chat sessionpolicy_setting Contains archiving detailsreport_setting Not in use sessioninfo Contains details of current session user_info Not in useuserlog Not in useusers Contains userid/password and other details of admin
MySQL Commands:
To create database ‘ims’ through script file
C:/>mysql –u USERNAME –h IP-ADDRESS ims < path of script file
To dump database into mysql
C:/> mysql –u USERNAME –h IP-ADDRESS > path of script file
To grant privileges on mysql server
mysql> grant all privileges on ims.* to ' USERNAME '@ ‘IP-ADDRESS' identified by 'PASSWORD';
Deployment of Web Interface
Note: To deploy web interface (GUI) on Web Server we need to create war file
How to Create War file
Steps:
Go to Command prompt < go to the directory of your web application where all your jsp pages are present.
e.g.: 1. C:\PIM\Public IM
Delete the Directory “META-INF”
Execute the command jar –cvf name.war *.*
e.g.: jar –cvf Arcmentor.war *.*
Press Enter
How to Deploy war File
Apache Tomcat Web Server
Steps:
Go to the webapps Directory of Tomcat web server
e.g.: C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps
Paste the war file Restart the Tomcat web Server
Start Menu < Programs < Apache Tomcat < Monitor Tomcat < right click on the small icon of Apache Tomcat on the status bar < Start Services.
Sun One Web Server
Steps:
Right Click on My Computers < Manages < Services Applications < Services < right click on sun one web Server < start. Type the URL on the browser “http://IP-Address:8888” Open console for sun one
web server6.1 Go to -- manage button -> virtual server class -> click on hyperlink -> web
Application -> browse path for war file -> Apply button ->Apply changes.
Design Pattern Used: Model View Controller(MVC)
Here ArcmentorController is the main controller which redirects all the JSP pages to servlets where actual processing is done and after executing process it sends response back to view.
Features:
View Controller Model
Arcmentor Controller
(Servlet)
IM Status.jsp
Administration.jsp
Users.jsp
AuditMessaging.jsp
Knowledge.jsp
Report.jsp
Advanced.jsp
Login Command
Admin Manage Command
User Manager Command
Audit Message Command
DB
DBConnection
Login Screen Status page Administrator
o Add Admin o Admin Managemento Change Passwordo Keyword Notification
Audit Messagingo Current Sessiono Past Sessiono Session Audit
Knowledge Managemento Retrieve Expertiseo Keyword Searcho File Search
Reportso Traffic Monitor
Daily Weekly Monthly Custom
o User Monitor Daily Weekly Monthly Custom
Advancedo Archive Backup/Restoreo Archive Settingso Clusteringo Report Settingso Database Settingso Licensing
Logout
Logical Flow
Login Page
Function: The first screen, where the admin logs in. The user can select the display
language as English or Chinese by selecting the appropriate option in the drop combo box.
Grid shows the status of Primary database, Secondary Database, Clustering and Current Reporting Database.
JSP Page:
index.jsp
Servlet:
ArcmentorController, LoginCommand
Flow:
Index.jsp -> ArcmentorController -> LoginCommand -> Status.jsp
Database Tables:
users, cluster_sys_info
Working:
By default userid: guest Password: guest
When admin enters userid/password and press Login button the request goes from ‘index.jsp’ page to ‘ArcmentorController’ where caller will be ‘index’ Where it sets language as selected in combo box i.e. English/Chinese.
request.setAttribute("LANGNO",Integer.toString(combsel)); Locale lang = new Locale (Language,Country); ses.setAttribute("lang",lang);
The request is then send to the ‘LoginCommand’ where it checks for the userid and password entered is valid or not
Query:
select * from USERS where USERID = '"+adminid+"' AND PASSWORD = '"+password+"' AND ACTIVE = 'A'"
if there will be such userid and password in the table ‘users’ then the ‘status.jsp’ page will gets open. If userid and password will be invalid then ‘Error.jsp’ page will gets open.
If the userid and password will be valid then object ‘user’ with value as ‘valid’ gets created on the server and remains there , if any process will not take place within 30 minutes then the object gets destroyed from the server and login pages displays.
session = request.getSession(true); session.putValue("user", "valid");
In Tomcat server time is set to 30 minutes, if the some execution is not happening then after 30 minutes session will expired.
In web.xml file the tag is used ----
<session-config> <session-timeout>30</session-timeout> </session-config>
If connection is made for Primary Database as user name and password is provided in Arcmentor.ini file then it will show status as ‘ON’ else ‘OFF’.
If connection is made for Secondary database as user name and password is provided in Arcmentor.ini file for secondary db then status will be ‘ON’ else ‘OFF’.
On index.jsp page it checks for clustering, if there will be two entries in the table ‘cluster_sys_info’ then status for clustering will be ‘ON’.
Current Reporting Database will be Primary or Secondary as set into Advanced < Report Setting.
Status Page
Function:
After the successful login, the first screen that comes up shows the IM status. It shows Graphical and Tabular format of total number of Messages and Sessions.
Tabular:
It shows the Total number of Messages, Sessions, User Accounts, Byte Transmitted, User Logged on,Clustering,Secondary Database,Cutternt Reporting Database and Database Size of current hour, current day and total count.
Graphical:
First graph shows the total number of Messages and Session of each hour of current day.
Second graph shows the total number of Messages and Session of each day of current month.
Graph displayed will be Applet, if the user’s browser is not Java enabled then the graph will be displayed as image.
JSP Pages:
Status.jsp, StatusGraphs.jsp
Servlets:VbarchartServlet, VbarchartApplet.class
Library:Vbarchart.jar, PngEncoder.jar
Flow:
If the userid ad password entries in the login page are correct then first page displayed will be status page.
Database Tables:
messages, sessioninfo, cluster_sys_info
Working:
First it reads Arcmentor.ini file to make connection with the MySQL Database. Once the database gets connected, it queries to the db for count of total no. of Messages, Sessions etc.
Applet:
Jar file name ‘Vbarchart.jar’ is added. There is class name ‘VbarchartApplet.class’ have used to generate applet.
<applet code="VbarchartApplet.class" archive="Vbarchart.jar" width="900" height="360">
Image:
If the browser is not Java enabled then applet cannot be generated and
instead of graph link will be displayed. Onclick link the request goes to StatusGraphs.jsp page.
Note: StatusGraphs.jsp is same as Status.jsp only difference is instead of applet, image gets generated.
<center><img src="VbarchartServlet?label=hours" ></center>
VbarchartServlet.class: This is third party class file only little changes are made in this file, logic to generate image graph is not changed at all.
Changes made are:
1. Connection to the database2. Get the parameters from the StatusGraph.jsp page.3. Properties are set in ConfigData() function.4. Values are passed to the GraphData() function.
Add Admin
Function:
This feature allows adding new admin. The administrators thus added can log on to the Arcmentor Interface. However, only those Admin’s who are active are able to log in.
JSP Pages:
AddAdmin.jsp
Servlet:
ArcmentorController, AdminManageCommand
Flows:
AddAdmin.jsp -> ArcmentorController -> AdminManageCommand -> AddAdmin.jsp
Database Table:
users
Working: When the user enters values for text boxes Admin Id, Password, First
Name, Last Name cell no. and click on Submit button then request is redirected to the ‘ArcmentorController’ where caller will be ‘AddAdmin’. From there the request goes to the AdminManageCommand.
AdminManageCommand gets all the parameters of text field and insert all values into the ‘users’ table of ims database.
Query:
insert into USERS values('"+adminid+"','"+password+"','"+firstname+"','"+lastname+"','"+cellno+"','"+active+"','N')
Admin Management
Function:
The Admin Management menu under the Administrator tab allows the user to edit or delete the Administrators
JSP Page:
AdminManage.jsp
Servlet:
ArcmentorController, AdminManageCommand
Database Table:
users
Flow:
AdminManage.jsp -> ArcmentorController -> AdminManageCommand -> AdminManage.jsp
Working:
When user clicks on the Admin Management tab of the Administrator from Menu the request goes to the ArcmentorController where caller will be ‘AdminManage’. Then the request is redirected to the ‘adminMange()’ function of AdminManageCommand.
AdminManageCommand executes query and redirect to the AdminManage.jsp page.
Query:
select * from USERS order by FIRSTNAME asc;
Edit:
On Click on the Edit link, the above screen appears, caller will be ‘AdminManageEdit’ and request goes to the ‘doChange()’ function of the AdminManageCommand. where query will be execute as
Query:
"delete from USERS where USERID='"+req.getParameter("txtUserIdHidden") +"'";
Delete:
On Click on the Edit link the caller will be ‘AdminManageDelete’ and request goes to the ‘doChange()’ function of the AdminManageCommand.Where query will be execute as
Query:
"select * from USERS where USERID='"+req.getParameter("txtUserIdHidden")+"'"
Change Password
Function:
The Change Password allows the user who is currently logged in to change his own password.
JSP Page:
ChangePassword.jsp
Servlet:
ArcmentorController, AdminManageCommand
Database Table:
users
Flow:
Changepassword.jsp -> ArcmentorController -> AdminManageCommand -> Changepassword.jsp
Working:
When user enters old and new password and click on submit button then request goes to the ArcmentorController where caller will be ‘ChangePassword’ then request is redirected to the ‘doEditPass()’ function of the AdminManageCommand.
Query:
"update USERS set PASSWORD='"+NEWpass+"' where USERID='"+adminuser1+"'"
Keyword Notification
Function:
The Keyword Notification screen allows the user to add keyword. A keyword is any word, which when used by any user during his chat session will cause an email alert to be sent to the email addresses of the administrators whose email addresses are
added. JSP Page:
CustomKeywords.jsp
Servlet: ArcmentorController, AdminManageCommand
Database Table:
keywords
Flow:
CustomKeywords.jsp -> ArcmentorController -> AdminManageCommand -> CustomKeywords.jsp
Working:
When user enters keywords and Email id’s click on Insert button then request goes to the ArcmentorController where caller will be ‘KeywordsShow’ then request is redirected to the ‘doKeyShow()’ function of the AdminManageCommand.
In AdminManageCommand depend on the caller (update/insert/show/delete/edit/insertupdate/submit) the Attribute is set. Then this attribute and Resultset is redirected on the CustomKeywords.jsp page.
On CustomKeywords.jsp details like keywords and Email ids are displayed from the Resultset.
Edit and Delete
When we click on the edit link the request goes to the ArcmentorController where caller will be ‘KeywordsEdit’ it calls the ‘doKeyChange()’ function of AdminManageCommand. Where Query will execute will be:
Query
"select * from KEYWORDS where KEYWORD='"+req.getParameter("txtKeyword")+"'"
Delete
When we click on the edit link the request goes to the ArcmentorController where caller will be ‘KeywordsDelete’ it calls the ‘doKeyChange()’ function
of AdminManageCommand. Where Query will execute will be:
Query
"delete from KEYWORDS where KEYWORD='"+req.getParameter("txtKeyword") +"'"
Current Session
Function:
The Current Session menu under Audit Messaging allows seeing the current chat sessions of the users who are currently logged in.If the keyword is selected and the User is deselected, it will show the chat only those chat sessions in which that keyword is used.If both User and keyword are selected, it will show only those chat session of that user in which the keyword is used.
JSP Page:
Current.jsp, CurrentAuditResults.jsp
Servlet:
No Servlets
Database Table:
messages,sessioninfo
Flow:
Current.jsp -> CurrentAuditResults.jsp
Working:
When admin selects user on Current.jsp and clicks on search button then request goes to the CurrentAuditResults.jsp where it gets the value of the combo box and whichCriteria to be execute. Then get the connection from the database and execute the query.
select DISTINCT MESSAGES.SESSIONID,MESSAGES.FROMID,MESSAGES.TOID,MESSAGES.STARTDATE,MESSAGES.STARTTIME,MESSAGE from MESSAGES,SESSIONINFO where MESSAGES.SESSIONID=SESSIONINFO.SESSIONID and (MESSAGES.FROMID='"+cmbsingle+"' OR MESSAGES.TOID='"+cmbsingle+"') and MESSAGES.STARTDATE=now() GROUP BY MESSAGES.SESSIONID order by MESSAGES.STARTTIME desc
if admin selects both the user and the keyword on Current.jsp then the query will be
select DISTINCT MESSAGES.SESSIONID,MESSAGES.FROMID,MESSAGES.TOID,MESSAGES.STARTDATE,MESSAGES.STARTTIME,MESSAGES.MESSAGE from MESSAGES,SESSIONINFO where (MESSAGES.SESSIONID = SESSIONINFO.SESSIONID) and (MESSAGES.FROMID='"+cmbsingle+"') and Instr(MESSAGES.MESSAGE,'"+keyword+"') > 0 GROUP BY MESSAGES.SESSIONID order by MESSAGES.STARTTIME desc
if admin selects only the keyword on Current.jsp then the query will be
select DISTINCT MESSAGES.SESSIONID,MESSAGES.FROMID,MESSAGES.TOID,MESSAGES.STARTDATE,MESSAGES.STARTTIME,MESSAGES.MESSAGE from MESSAGES,SESSIONINFO where (MESSAGES.SESSIONID = SESSIONINFO.SESSIONID) and Instr(MESSAGES.MESSAGE,'"+keyword+"') > 0 GROUP BY MESSAGES.SESSIONID order by MESSAGES.STARTTIME desc
Past Session
Function:
The Past Session menu under Audit Messaging allows seeing the all past chat sessions of the users by selecting different criteria’s like date, time ,users,keywords,sessionid or combinations.
JSP Page:
UserAudit.jsp, UserResults.jsp, UserAuditResults.jsp
Servlet: ArcmentorController, AuditMessagCommand, DBConnection
Database Table:
messages
Flow:
UserAudit.jsp -> ArcmentorController -> DBConeection -> AuditMessageCommand -> UserResults.jsp
Working:
When user clicks on ‘Search’ button the JavaScript function is called where query is set for each criterion. Selected criteria sets query String into hidden variable and submitted to ‘ArcmentorController’ where caller is ‘PastAuditShow’ and again from there request is redirected to ‘AuditMessageCommand‘.
In AuditMessageCommand ‘‘fetchPastUser ()’ method is invoked where caller will be ‘PastAuditShow’
Note: If there will be more then 40 records in the database then TIMELINE BAR will be displayed with 10 records on each page.
Timeline Bar:
Admin can see the records by moving backward/forward on clicking Left/right edges of the Time-Line bar or by clicking anywhere on the Time-Line bar.
the method in the JavaScript--- microsoftMouseMove()--to get the x,y value where mouse clicked.
function microsoftMouseMove(){ document.form.x.valu=e.ScreenX; document.form.y.valu=e.ScreenY;}
x value get transferred to the servlet(position from the left end of the screen) length of the bar is 570
X-222=a570-a= absolute position of the bar.
records divided on the timeline bar on the average of 40 records.
avg= (570/total_rec)*40
rec_no. = x pos * tot_rec / 57 ----- this gives the position where mouse clicked.
rs5.absolute (rec_no.)----- this gives the record
From this record next 40 records displayed in desc order.
fetchPastUser () is having 4 if conditions for
PastAuditShow, PastSessionPrev, PastSessionNext, PastSessionClk
On click on the left of the TimeLine Bar ‘PastSessionPrev ()’ method is invoked, on click on the right side of the TimeLine bar ‘pastSessionNext()’ method is invoked and on click on the middle of the TimeLine Bar ‘PastSessionClk()’ is invoked.
If users select Specific Search where search on the bases of ‘Sessionid’ then the flow will be
UserAudit.jsp -> ArcmentorController -> DBConeection -> AuditMessageCommand -> UserAuditResults.jsp.
Session Audit
Function:
The Session Audit menu under the Audit Messaging tab allows the admin to view sessions with details like sessionId, startdate, starttime, and users in session and total message count and also shows the messages are audited or not. By clicking on particular sessionid admin can view details of that session with fromid, message sent time messages and allows admin to add comments for selected sessionid. Other admin can also add comments for the same sessionid but cannot change the comment added by other admin. The sessions which got audited will be shown checked in the Audited field of the session audit page.
It also provides different filtering options. Filtering is done on the basis of userId, date and time.
JSP Page:
AuditSession.jsp, ShowSession.jsp
Servlet:
ArcmentorController, SessLog, DBConnection
Database Table:
Messages, audit_details
Flow: ArcmentorController -> SessLog -> AuditSession.jsp
Working:
When the user clicks on the Session Audit tab from the menu the request first goes to the ‘ArcmentorController’ where caller will be ‘ShowAuditSess’ from where it calls the ‘SessAudit()’ method of ‘SessLog’ servlet .
There are 4 if conditions into SessAudit() method where caller will be
ShowAuditSess, Sessiontick, Sessionup, Sessiondown
First time caller will be ‘ShowAuditSess’, if sessions are more then 40 in the database then timeline bar will be displayed. (Logic for time line bar will be same as for Past Session).
On clicking left of the timeline bar caller will be ‘Sessiondown’ and clicking on right of the timeline bar caller will be ‘Sessionup’ . And on clicking on the middle of the timeline bar caller will be ‘Sessiontick’.
There will be 5 cases in each conditions for because 5 different criteria’s are there to see the sessions i.e. for all, userid, Date, time and severity. Query for condition ‘useid’ as shown below:
Query:
"select DISTINCT SESSIONID,STARTDATE,STARTTIME,FROMID,AUDITED,count(*) from MESSAGES where ((FROMID like '"+Pattern_val+"') or (TOID like '"+Pattern_val+"'))group by SESSIONID order by STARTDATE desc ,STARTTIME desc"
On clicking on the Sessionid link the request goes to ‘ShowSession.jsp’ as shown below:
It shows the Session details and allows admin to audit the session. There are 3 buttons on the page i.e. ‘Back’,’Audit’,’Email This Session’.
On clicking ‘Back’ the ‘ShowSession.jsp’ page gets close. The function written in JavaScript named ‘funClose()’.
Current admin name (Audit by), current Date(Audit Date) and time (Audit Time) are displayed.
Current Admin name is get from ‘LoginCommand’ where ‘AdminUser’ is set.
session.setAttribute("AdminUser",adminid);
on ‘ShowSession.jsp’ value is get as
adid=(String) session.getAttribute("AdminUser");
Current date and time is getting from the ‘Calendar’ class.
Calendar cal = Calendar.getInstance();java.util.Date today = cal.getTime();SimpleDateFormat fmt =new SimpleDateFormat("yyyy-MM-dd");String todayStr = fmt.format(today);java.util.Date ndt1 = new java.util.Date();SimpleDateFormat s1 = new SimpleDateFormat("yyyy-MM-dd");String dt = s1.format(ndt1);String Cur_time= ndt1.getHours()+":"+ndt1.getMinutes()+":"+ndt1.getSeconds();
On clicking ‘Audit’ button data is inserted into table ‘audit_details’
Query:
"insert into AUDIT_DETAILS(SESSION_ID,SESSION_AUDITOR,AUDIT_DATE,AUDIT_TIME,SESSION_LVL,COMMENTS) values('"+sessionid+"','"+Aid+"','"+Adate+"','"+Atime+"','"+ Slvl+"','"+cmt+"')"
On clicking ‘Email this Session’,mail will be sent to the respective admin containing the session details.For sending mail ‘javax.mail’ API is used. For using this API we need to add ‘activation.jar’ And ‘mail.jar’ into lib folder and need to import “javax.mail.internet.*,java.util.Properties”
Retrieve Expertise
Function: The Retrieve Expertise menu under the Knowledge Management allows the user to see the percentile usage of a keyword by different users as shown below. The maximum user of a keyword is taken as the basis (i.e. 100 %) and then the percentage is given to other users depending on the no of times they have used the keyword.
JSP Page:
KeywordExpertise.jsp, ExpertiseResults.jsp
Servlet:
No Servlets
Database Table:
messages
Flow:
KeywordExpertise.jsp -> ExpertiseResults.jsp
Working:
When user enters keyword on KeywordExpertise.jsp page and click on each button then request goes to the ExpertiseResults.jsp with the text field value. Then gets the database connection and execute the query:
Query:
"select count(*) as cnt ,FROMID from MESSAGES where instr(MESSAGE,'"+keyword+"') > 0 group by FROMID order by cnt desc"
File Search
Function:
The File Search menu under the Knowledge Management allows admin to search the details of the particular session in which the transfer of the entered file name has been done. Details show the session Id, start date, and start time, from Id and file detail. File search can be done by entering initials of the file name or *.*
JSP Page:
FileSearch.jsp, FileResult.jsp, Filehyperlink.jsp
Servlet:
No Servlet
Database Table:
messages
Flow:
FileSearch.jsp -> Fileresult.jsp
Working:
When user clicks on ‘File Search’ tab of the menu then ‘FileSeach.jsp’ Page gets loaded. File search can be done by inserting initial of the file of *.* and also by selecting users.
If user selects only file name then criteria is set as ‘0’,if user selects file name with users then criteria will set as ‘1’
That criteria is passed to the ‘FileResult.jsp’ page and depend on the criteria the query is executed as:
"select * from MESSAGES where MESSAGE like '"+filename+"' order by
STARTDATE desc, STARTTIME desc "
Or
"select * from MESSAGES where MESSAGE like '"+filename+"' and FROMID IN("+users+") order by STARTDATE desc, STARTTIME desc"
On clicking file name link goes to “Filehyperlink.jsp”
“<a href="/Arcmentor/Filehyperlink.jsp?filename=<%=s9%>" target='_self'>”
This is to download file, In “Filehperlink.jsp” method is written in html as:
<do: download file="<%=filename%>" dir="C:/Arcmentor/attachments" Inline="false"/>
Keyword Search
Function: Keyword Search is tab under Knowledge Management menu. This allows admin to search the sessions in which particular keyword is used. When admin enters keyword and submit it then those session details will be displayed in which that keyword is used.
JSP Page:
Keywordsearch.jsp, KeywordResult.jsp
Servlet:
No Servlet
Database Table:
messages
Flow:
Keywordsearch.jsp -> KeywordResult.jsp
Working:
When user clicks on ‘Keyword Search’ tab of the menu then ‘KeywordSearch.jsp’ page gets loaded. When user enters key word into text box and press submit then URL sent to ‘KeywordResult.jsp’.
In ‘KeywordResult.jsp’ query is executed as:
Query:
"select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE from MESSAGES where instr(message,'"+ parameter+"')>0 GROUP BY SESSIONID order by STARTDATE desc,STARTTIME desc"
Traffic Monitor
There are 4 sub menus under ‘Traffic Monitor’. Daily, Monthly, Weekly and Custom.
Function:
In Daily report admin can select the date, the graph display will be hours versus messages, it will display the total message count in graphical format on the hour on which message is sent or received for the selected date.In Weekly report admin can select month, year and week, graph will be weekdays versus Messages. It will show total count of messages in graphical format on different days of the selected week.In Monthly report admin can select the month and year. The graph will be days versus messages. It will show the total count of the messages on all days of the selected month.In Custom report admin can select range of days between which he wants to see the chat sessions. The graph is Line graph. First it will show the count of messages on selected day, clicking on dot it shows total messages counts on different hours for that day.
JSP Page:
TMonitor.jsp, ShowReports.jsp, ShowCustomReports.jsp, ImageReports.jsp, CustomImageReport.jsp
Servlet:VbarchartServlet, VbarchartApplet.class, LineGraphServlet.class
Library:Vbarchart.jar, PngEncoder.jar
Database Table:
messages
Flow:
TMonitor.jsp -> ShowReports.jsp
Working:
o Daily
When user clicks on daily sub menu then the URL goes as: "TMonitor.jsp?caller=day"And page as show below displayed:
When the user clicks on ‘Search’ button then the ‘fnDay()’ function of JavaScript will gets invoked, which will open new window as:
open("ShowReports.jsp?caller=dayonly&printdate1="+printdate1+"&ondate1="+ondate,"mynew","width=900,height=600,status=0,top=100,left=50,resizable=yes");
ShowReports.jsp generates Applet graph. In this jsp page caller will be “dayonly”. Where parameters like date which user have inserted are get and query is executed as:
"select count(*),HOUR(STARTTIME) from MESSAGES where STARTDATE='"+ondate+"' group by HOUR(STARTTIME) order by HOUR(STARTTIME) asc";
With this query we can find the number of counts for the particular day what user have inserted and give these parameters to the Applet to generate graph as shown below.
o Weekly
When user clicks on weekly sub menu then the url goes as: "TMonitor.jsp?caller=week" And page as show below displayed:
When the user clicks on ‘Search’ button then the ‘fnWeek ()’ function of JavaScript will gets invoked, which will open new window as:
open("ShowReports.jsp?caller=week&month="+document.form.cmbWMonth.value+"&year="+document.form.cmbWYear.value+"&week="+document.form.cmbWeek.value,"mynew","width=900,height=600,status=0,top=100,left=50,resizable=yes");
ShowReports.jsp generates Applet graph. In this jsp page caller will be “week”. Where parameters like month, week,year which user have inserted are get and query is executed as:
"select count(*) as ct,STARTDATE from MESSAGES where (STARTDATE between '"+weekdt[0]+"' and '"+weekdt[6]+"') group by STARTDATE ORDER by STARTDATE asc";
With this query we can find the number of counts for the particular week what user have inserted and give these parameters to the Applet to generate graph as shown below.
o Monthly
When user clicks on weekly sub menu then the url goes as : "TMonitor.jsp?caller=month” And page as show below displayed:
When the user clicks on ‘Search’ button then the ‘fnMonth()’ function of JavaScript will gets invoked, which will open new window as:
open("ShowReports.jsp?caller=month&month="+document.form.cmbMonth.value+"&year="+document.form.cmbYear.value,"mynew","width=900,height=600,status=0,top=100,left=50,resizable=yes");
ShowReports.jsp generates Applet graph. In this jsp page caller will be “month”. Where parameters like month,week,year which user have inserted are get and query is executed as:
"select count(*) as ct,STARTDATE from MESSAGES where (STARTDATE between '"+weekdt[0]+"' and '"+weekdt[6]+"') group by STARTDATE ORDER by STARTDATE asc";
With this query we can find the number of counts for the particular week what user have inserted and give these parameters to the Applet to generate graph as shown below.
o Custom
When user clicks on weekly sub menu then the url goes as: "TMonitor.jsp?caller=custom".And page as show below displayed:
Note: LinGraph is used to show custom reports.
When the user clicks on ‘Search’ button then the ‘fnCustom ()’ function of JavaScript will gets invoked. First the graph will be displayed for year then month -> days-> hour as shown below:
open("ShowCustomReports.jsp?caller=hour&month="+document.form.cmbFromMonth.value+"&year="+document.form.cmbFromYear.value+"&fromdate="+fromdate+"&day
="+document.form.cmbFromDate.value+"&todate="+todate,"mynew","width=820,height=570,status=0,top=130,left=90,resizable=yes");
‘ShowCustomReports.jsp’ generates Applet graph. On depending caller as “year”,”moth”,”week”,”hour” different query’s get executed and values are passed to the applet to generate graph.
Image:
If users browser is not java enabled then it will not generate applet, instead of it user will get a link on which if clicks then image gets generated.
Flow for daily, weekly and monthly is:
TMonitor.jsp -> ShowReports.jsp -> ImageReport.jsp -> VbarchartServlet
Flow for Custom is:
TMonitor.jsp -> ShowCustomReports.jsp -> CustomImageReport.jsp -> LineGraphServlet
User Monitor
There are 4 sub menus under ‘User Monitor’. Daily, Monthly, Weekly and Custom.
Function:
In Daily report admin can select the date and user for which he wants to see the chat sessions, The graph display will be hours versus messages, it will display the total message count in graphical format on the hour on which message is sent or received for the selected date and selected user.In Weekly report admin can select month, year week, and userid of the user, the graph will be Weekdays versus Messages. It will show total count of messages on different days of the selected week for the selected user.In Monthly report admin can select the month, year and user. The graph will be days vs. messages. It will show the total count of the messages on different days of the selected month for the selected user.In Custom report admin can select range of days and userid of the user. The graph is Line graph. Range of days can be select between which admin wants to see chat session for particular users, clicking on the dot shows line graph for hours versus messages for the selected range of days and selected user.
JSP Page:
UMonitor.jsp, ShowReports.jsp, ShowCustomReports.jsp ImageReports.jsp, CustomImageReports.jsp
Servlet:
VbarchartServlet, VbarchartApplet.class, LineGraphServlet.class
Library:
Vbarchart.jar, PngEncoder.jar
Database Table:
messages
Flow:
UMonitor.jsp -> ShowReports.jsp
Working:
o Daily
When user clicks on daily sub menu then the url goes as: "UMonitor.jsp?caller=day”. And page as show below displayed:
When the user clicks on ‘Search’ button then the ‘fnDay()’ function of JavaScript will gets invoked, which will open new window as:
open("ShowReports.jsp?caller=Udayonly&printdate1="+printdate1+"&ondate="+ondate+"&cmbsingle="+cmbsingle,"mynew","width=900,height=600,status=0,top=100,left=50,resizable=yes,scrollbars=1");
ShowReports.jsp generates Applet graph. In this jsp page caller will be “Udayonly”. Where parameters like date which user have inserted are get and query is executed as:
"select distinct SESSIONID from MESSAGES where STARTDATE = '"+ondate+"' AND (FROMID IN("+cmbsingle+") or TOID IN("+cmbsingle+")) order by STARTDATE asc"
With this query we can find the number of counts for the particular day and particular users what user have inserted and give these parameters to the Applet to generate graph as shown below.
o Weekly
When user clicks on weekly sub menu then the url goes as : "UMonitor.jsp?caller=week". And page as show below displayed:
When the user clicks on ‘Search’ button then the ‘fnWeek ()’ function of JavaScript will gets invoked, which will open new window as:
open("ShowReports.jsp?caller=Uweek&week="+document.form.cmbWeek.value+"&year="+document.form.cmbWYear.value+"&cmbsingle="+cmbsingle+"&month="+document.form.cmbWMonth.value,"mynew","width=900,height=600,status=0,top=100,left=50,resizable=yes,scrollbars=1");
ShowReports.jsp generates Applet graph. In this jsp page caller will be “Uweek”. Where parameters like month, week, year and users name which user have inserted are get and query is executed as:
"select distinct SESSIONID from MESSAGES where STARTDATE between '"+weekdt[0]+"' and '"+weekdt[6]+"' AND (FROMID IN("+cmbsingle+") or TOID IN("+cmbsingle+")) ORDER by STARTDATE asc";
With this query we can find the number of counts for the particular week what user have inserted and give these parameters to the Applet to generate graph as shown below.
o Monthly
When user clicks on weekly sub menu then the url goes as: "UMonitor.jsp?caller=month".And page as show below displayed:
When the user clicks on ‘Search’ button then the ‘fnMonth()’ function of JavaScript will gets invoked, which will open new window as:
open("ShowReports.jsp?caller=Umonth&month="+document.form.cmbMonth.value+"&cmbsingle="+cmbsingle+"&year="+document.form.cmbYear.value,"mynew","width=900,height=600,status=0,top=100,,left=50,resizable=yes,scrollbars=1");
ShowReports.jsp generates Applet graph. In this jsp page caller will be “Umonth”. Where parameters like month, week,year which user have inserted are get and query is executed as:
"select distinct SESSIONID from MESSAGES where month(STARTDATE)='"+intmonth+"' AND year(STARTDATE)='"+year+"' AND (FROMID IN("+cmbsingle+") or TOID IN("+cmbsingle+")) ORDER by STARTDATE asc";
With this query we can find the number of counts for the particular week what user have inserted and give these parameters to the Applet to generate graph as shown below.
o Custom
When user clicks on weekly sub menu then the url goes as: "UMonitor.jsp?caller=custom".And page as show below displayed:
Note: LinGraph is used to show custom reports.
When the user clicks on ‘Search’ button then the ‘fnCustom ()’ function of JavaScript will gets invoked. First the graph will be displayed for year then month -> days-> hour as shown below:
open("ShowCustomReports.jsp?caller=Uhour&month="+document.form.cmbFromMonth.value+"&year="+document.form.cmbFromYear.value+"&fromdate="+fromdate+"&day="+document.form.cmbFromDate.value+"&todate="+todate+"&cmbsingle="+cmbsingle,"mynew","width=820,height=570,status=0,top=130,left=90,resizable=yes,scrollbars=1");
‘ShowCustomReports.jsp’ generates Applet graph. On depending caller as “Uyear”,”Umoth”,”Uweek”,”Uhour” different query’s get executed and values are passed to the applet to generate graph.
Image:
If users browser is not java enabled then it will not generate applet, instead of it user will get a link on which if clicks then image gets generated.
Flow for daily, weekly and monthly is:
UMonitor.jsp -> ShowReports.jsp -> ImageReport.jsp -> VbarchartServlet
Flow for Custom is: TMonitor.jsp -> ShowCustomReports.jsp -> CustomImageReport.jsp -> LineGraphServlet
Archive Backup/Restore
Function: This submenu contains three features:
BackupBackup feature is used when admin wants to make copy of the archive. By clicking on backup the data from the database copied into the local machine and prompts to save it.
Backup & purgeThe “Button Backup & purge” allows to first backup the archive to local machine and then delete the archive table.
RestoreThe “Browse” button when pressed suggests admin to select the file from local machine, which is to be uploaded. The “Restore” button uploads the selected archive file from local machine to server and restores the contents back to Archive table.
JSP Page:
ArchiveBack.jsp
Servlet:
ArcmentorController, DBConnection, Archive
Database Table:
BACKUP_RESTORE
Flow:
ArchiveBack.jsp -> ArcmentorController -> Archive -> ArchiveBack.jsp
Working:
Backup:
When user clicks on “Backup” button then url sent will be “ArcmentorController?caller=backup”. Where it calls “archiveBack()” of ‘Archive’.
Caller will be “backup” and Query will be execute to insert date on which backup is take into “BACKUP_RESTORE” table.
Query:
"insert into BACKUP_RESTORE (LAST_BACKUP_DATE,LAST_PURGE_DATE) values ('"+dt+"','0000-00-00')"
Backup & Purge
When user clicks on “purge” button then url sent will be “ArcmentorController?caller=purge”. Where it calls “archiveBack()” of ‘Archive’.
Caller will be “purge” and Query will be execute to insert date on which backup is take into “BACKUP_RESTORE” table.
Query:
"insert into BACKUP_RESTORE (LAST_BACKUP_DATE,LAST_PURGE_DATE) values ('0000-00-00','"+dt+"')"
Restore
When user clicks on “Restore” button then url sent will be “ArcmentorController?caller=uploade”. Where it calls “archiveBack()” of ‘Archive’.
Caller will be “upload” where it gets the path that has been entered by the user as
saveFile = file.substring(file.indexOf("filename=\"") + 10);
Command to execute MySQL script to restore batabase is:
Mysqldump –u root ims > filepath
This command is executed to restore the database as:
Process p = rt.exec("cmd /c "+Command+" < " +filepath+ " "); Archive Setting
Function: The Auto/Manual radio button gives user the option either to choose manual or auto archiving option. Maximum Archive Age (Days):– this option allows admin to enter the no. of days corresponding to which the messages would be stored in ‘message’ table (e.g. if the value is 10 there will be messages corresponding to last 10 days in ‘message’ table rest will be archived and copied into ‘arc_message table’). Maximum Archive Size (KB):-This allows entering the threshold database size limit. (i.e. once the settings is saved for particular size the table will be archived when the threshold size reaches that is the ‘message’ table size will never exceed the above set size.). The table below shows the status of last archiving action that is date of last archiving, its type and the current size of ‘message’ table. The “Archive” button allows the user to manually archive the messages based on the set criteria.
Exclude list allows admin to enter userid whose data should not be archived, that userid is added into the ‘exclude_list’ table of the ims database. When the chatting session is created then the userid is compared with the ids which user has added into ‘exclude_list’ table, if the userid matched then data of that chat session is saved into ‘exclude_message’ table.
JSP Page:
Archiveset.jsp
Servlet:
ArcmentorController, DBConnection, Archive
Database Table:
POLICY_SETTING ,MESSAGES, EXCLUDE_LIST
Flow:
Archiveset.jsp -> ArcmentorController -> Archive -> Archiveset.jsp
Working:
When user click on menu “Archive Settings” then url sent will be “ArcmentorController?caller=ArchiveShow”
ArcmentorController calls the “archiveSet()” method of Archive setvlet class.
In archiveSet() method first the “POLICY_SETTING” table is read to get the values of see Auto Archiving or Manual Archiving is set and days+ size what user have entered.
Database size is get from the “MESSAGES” table.
msgsizeInt=msgsizeInt+msgsize.length();
if the size of the database is greater then the size what have entered then two queries will get execute as
"insert into ARC_MESSAGES(FROMID,TOID,STARTDATE,STARTTIME,ENDDATE,ENDTIME,MESSAGE,SESSIONID,SESSIONSTARTTIME,AUDITED) select * from MESSAGES where ((STARTDATE = '"+lastmsgstartdate+"' AND SESSIONSTARTTIME <= '"+sesStTime+"') OR (STARTDATE <= '"+prev+"'))";
“delete from MESSAGES where ((STARTDATE = '"+lastmsgstartdate+"' AND SESSIONSTARTTIME <='"+sesStTime+"') OR (STARTDATE <= '"+prev+"'))";
if Current date exceeded from the date what user have entered then the queries execute as:
"insert into ARC_MESSAGES(FROMID,TOID,STARTDATE,STARTTIME,ENDDATE,ENDTIME,MESSAGE,SESSIONID,SESSIONSTARTTIME,AUDITED) select * from MESSAGES where STARTDATE <= '"+dteString1+"'";
"delete from MESSAGES where STARTDATE <= '"+dteString1+"'";
when user entered values for Archive age and Arhcive size and press “Save Button” then “fnCheck()” function of JavaScript will be called which redirect
it to "ArcmentorController?caller=AddSettings" and query execute to update “POLICY_SETTING” table as:
"update POLICY_SETTING set POLICY_ARC_SIZE = '"+ArcSize1+"', POLICY_ARC_AGE = '"+Age1+"', AUTO_MAN = '"+Auto+"',AUTO_SET_DATE = '"+dt+"' "
Exclusion List
There is Textbox and “Add” button to add new name whose sessions are not to be included.
When user clicks on “Add” button the url sent as “ArcmentorController?caller=AddExclude”
ArcmentorController will call “archiveSet()” method of Archive Servlet class where caller will be “AddExclude”.
In “AddExclude” value of textbox is get and inserted into “EXCLUDE_LIST” table.
Query:
"insert into EXCLUDE_LIST (IM_USER_NAME ,STARTDATE ,STARTTIME ) values ('"+ExcludeId+"','"+dt+"','"+Cur_time+"') "
ResultSet is get on the ‘Archiveset.jsp’ page and id under Exclude_List is displayed.
Clustering
Function:
Clustering is used to save data into two databases. ‘Cluster shared secret password’ is the password saved into ‘cluster_pass’ table of the ‘ims ‘database. When admin wants to do clustering, he adds the IP address, username, password of the other machine, the information get added into ‘cluster_sys_info’ table. He can make any database as master out of two. When clustering is to be done, database of the secondary database is been checked, if it contains the same password as mention into ‘cluster_pass’ table of Primary database then only clustering can be done.
JSP Page:
Clustering.jsp, clusterAction.jsp
Servlet:
ArcmentorController, DBConnection, ClusterManage
Database Table:
cluster_sys_info, cluster_pass
Flow:
Clustering.jsp -> ArcmentorController -> DBConnection -> ClusterManage -> Clustering.jsp
Working:
When user enters cluster secret password the Arcmentor.ini file and “cluster_sys_info” table gets updated. The value of the textbox is get on the “addCluster()” method of the ClusterManage where query is executed to update “CLUSTER_SYS_INFO” the table as
"update CLUSTER_SYS_INFO set CLUSTER_SYS_PWD='"+shpwd+"'"
And WriteINI() is called to update Arcmentor.ini file.
Values of ClusterSystem , username, Password ,Master are read from the “cluster_sys_info” table and pass as Resultset to Clustering.jsp page.
When user clicks on “Edit“ link then url will be sent as "ArcmentorController?caller=ClusEdit"
clusterEditdel() method of ClusterManage will be called where caller will be “ClusEdit” and query is executed as:
"select * from CLUSTER_SYS_INFO where CLUSTER_SYS_NO ='"+editclusno+"' "
This query is executed to find which database is to update. Then “show()” method is called where DBConnection is done then resultSet is send to the “Clustering.jsp” page then resultant page will be displayed as:
Note: ClusterIP of Master will be disable because if we change the IP address of the master database then values are get updated into Arcmentor.ini file also and then connection will not be done.
When user updates the values of the user name and password and press submit button then url sent as: "ArcmentorController?caller=Clussubmit" where text values are get and updated into “cluster_sys_info” database.
Query:
"update CLUSTER_SYS_INFO set CLUSTER_SYS_IP='"+Edip+"',MST_YESNO='"+Edyn+"',CLUSTER_DB_USER='"+Eduid+"',CLUSTER_DB_PWD='"+Edpwd+"' where CLUSTER_SYS_NO = '"+Edno+"'"
Arcmentor.ini file gets updated by calling WriteINI() method.
When user press the “Delete” button then url sent as "ArcmentorController?caller=ClusDelete" where caller will be “ClusDelete” in “ClusterManager” and query executed as:
Query:
"delete from CLUSTER_SYS_INFO where CLUSTER_SYS_NO ='"+Delclusno+"'"
When user clicks on “submit” link URL send to “ClusterManager” where it checks for the DBConnection if the values entered are making connection to the database then the url will be redirected to “ClusterAction.jsp”The page displayed as:
When user clicks on “Yes” button then URL redirected to “ArcmentorController?caller=Clussubmiting” of “ClusterManage”. Where caller will be “Clussubmiting” in which query to update the “cluster_sys_info” and Arcmentor.ini
And WriteINI() method is called to update Arcmentor.ini file.
WriteINI()
FileOutputStream fileoutputstream1=null; BufferedReader bufferedreader = new BufferedReader(new FileReader(c:\\Arcmentor\\Arcmentor.ini));
Here every line is read and tokenize with “=” sign. Values from the database is read and replaced against “=” sign to update it.
Licensing
Function:
Licensing feature allows user to avail the full version of the ArcMentor after entering valid license key provided by us.
Installer will Install ‘ArcMentor’ that will be trial version and valid for 30 days after that to access ‘Arcmentor’ it need to be full version.
When Installer for ‘Arcmentor’ runs it execute ‘MAC.EXE’ that generates ‘LICENCE.TXT’ file, that file will be send by the user who want to use full version of ArcMentor.
‘LICENCE.TXT’ file will have the MAC address of the system where ‘ArcMentor’ is installed. We will generate Key using that MAC address and send that key back.
JSP Page:
licence.jsp Servlet:
No Servlet
Database Table:
No Database
Working:
When the user clicks on the menu ‘Licensing’ the ‘Licence.jsp’ page will gets open. In Licence.jsp value in comsrc.sys file is read
licencefile="c:\\WINNT\\system32\\comsrc.sys";BufferedReader br = new BufferedReader (new FileReader (licencefile));liceno = br.read();
while installing ‘ArcMentor’ first time ‘comsrc.sys’ file gets created on “C:\WINNT\System32\” and write value ‘1’ that means it is for trial version. If comsrc.sys file is already exist there then installer will not create it again.When user will enter valid license key and press ‘submit’ button then ‘lic.txt’ file will generate at ”C:\Arcmentor\’” from where we will get the Physical Address as:
Physical Address. . . . . . . . . : 00-11-11-B3-53-03
That will we converted into letters as:
lic=lic.replace('V','0'); lic=lic.replace('A','1');
lic=lic.replace('N','2'); lic=lic.replace('Q','3'); lic=lic.replace('W','4'); lic=lic.replace('E','5'); lic=lic.replace('R','6'); lic=lic.replace('T','7'); lic=lic.replace('Y','8'); lic=lic.replace('U','9'); lic=lic.replace('I','A'); lic=lic.replace('O','B'); lic=lic.replace('P','C'); lic=lic.replace('D','D'); lic=lic.replace('G','E'); lic=lic.replace('S','F'); lic=lic.replace('J','-');
after getting the new string we will compare that string with the key word what user have entered , if the comparison is true then the key word will be valid and the value in the ‘comsrc.sys’ will get updated to ‘3’ further screen appears as:
The values as shown above will be read from the Arcmentor.ini file.
If the 30 days gets over then ‘comsrc.sys’ will gets updated as ‘2’ and the screen appears as:
Note: checking for expiration of the product will be done at the logger side.
Report Setting
If entry into “cluster_sys_info” is only one (Primary)
If entry into “cluster_sys_info” is only two (Primary and Secondary)
Function:
The Past Session menu under Audit Messaging allows seeing the all past chat sessions of the users by selecting different criteria’s like date, time ,users,keywords,sessionid or combinations.
JSP Page:
dbselection.jsp
Servlet:
No Servlet
Database Table:
Cluster_sys_info
Working:
Here when user clicks on ‘Report Settings’ tab of the menu then ‘dbselection.jsp’ page gets loaded.Here when user clicks on ‘Report Settings’ tab of the menu then
‘dbselection.jsp’ page gets loaded.First it will check for number of count in “cluster_sys_info” as
“select count(*) as cnt from CLUSTER_SYS_INFO”.
If there will be only 2 entries into “Arcmentor.ini” file for both primary and secondary database and only one entry into “cluster_sys_info” then values of secondary database is inserted into it and value of count will set to ‘2’.
"insert into CLUSTER_SYS_INFO values('1','"+s10+"','','Y','"+s13+"','"+s11+"','"+s12+"')"
If the Database clustering present then the choice is given to the User to select between the database Clusters to view the GUI reports.
By default the Database is primary if user select the secondary database for viewing the report then the user Log in to the GUI again if the Log in authentication is always done through the Primary database only.
If again there is only one entry into ‘cluster_sys_info’ i.e. primary and report setting is done for secondary then the screen appears as login into primary database.
Database Setting
Function:
Database Setting allows user to change the settings of the Arcmentor.ini file because the database connection is done after reading the primary information of the Arcmentor.ini file like IP Address, user name and password.
JSP Page:
DBsettings.jsp
Servlet:
No servlet
Database Table:
No table
Working:
When admin clicks on Database Setting tab of the Advance menu then ‘DBsettings.jsp’ page gets loaded. When ‘DBsettings.jsp’ page loads it reads the Arcmentor.ini file,it reads the values of the primary database and display it in the text box as shown in the above figure.
To read the Arcmentor.ini file
BufferedReader br = new BufferedReader (new FileReader (“C:\\Arcmentor\\Arcmentor.ini”));
PrimaryDatabaseServerIP = br.readLine (); PrimaryDatabaseRootUser =br.readLine (); PrimaryDatabaseRootUserPassword =br.readLine (); s2 = PrimaryDatabaseServerIP.substring (24,PrimaryDatabaseServerIP.length ()); s3 = PrimaryDatabaseRootUser.substring (24,PrimaryDatabaseRootUser.length ()); s4 = PrimaryDatabaseRootUserPassword.substring
(32,PrimaryDatabaseRootUserPassword.length ());
If the admin changes the values in the text box and press submit then the values get updated into Arcmentor.ini file.
Email Setting
Function:
Email Setting under Advance tab allows admin to choose format in which way he wants to send mail. The Mail will be send to the Admin’s whom names admin have entered into the database and mail will also send to the users that admin have selected to whom he wants to send mail. Logger will automatically mail the current chat sessions to the admin/users after reading the database.
JSP Page:
EmailSess.jsp
Servlet:
ArcmentorController, AdminmanageCommand
Database Table:
message, emai_admin, email_user
Flow:
EmailSess.jsp -> AcrmentorController -> AdminManageCommand –EmailSess.jsp
Working:
When admin clicks on ‘Email Setting’ tab under advance menu then ‘EmailSess.jsp’ page gets loaded.
There are two check boxes to make admin/ser enable. If the check box is not checked then email will not be send.
Admin can also select the HTML/TEXT format to mail chat session.
Admin:
When admin selects only first check box and enter Email ID’s whom he wants to get the mail of the current sessions and press submit then url is redirected to “ArcmentorController?caller=EmailStructSave” where caller will be ‘EmailStructSave’ which redirected to ‘’EmailStruct()‘ method of the ‘AdminManageCommand’.
In ‘’EmailStruct()‘ caller will be ‘EmailStructSave’ , here it gets the parameter of the text box,check box(enable/disable) and format of the email (HTML/TEXT) and execute query to insert the data into ‘EMAIl_DOMAIN’ table of the database.
Note: The Email id’s of the Admin are first splited stored into array and then inserted.
Query:
"insert into EMAIL_ADMIN (ADMIN_ENABLE, ADMIN_EMAILID, EMAIL_FORMAT ) values ('"+admin_enable+"', '"+AdminEmailArray[a]+"', '"+emailformat+"')"
User:
When admin selects only second check box he needs to enter Domain Name and needs to select users whom he wants to send mail i.e. all users or particular users from the list box.
The values of the Domain name,user email id’s(All/selected), email format(HTML/TEXT) are passed from ‘EmailSess.jsp’ page to ‘AdminManageCommand’ and before inserting into database email id’s of user are splited and stored into array and then inserted into ‘EMAIL_USER’ table.
Query:
"insert into EMAIL_USER (USER_ENABLE, USER_EMAILID, EMAIL_FORMAT ) values ('"+user_enable+"', '"+UserEmailArray[a]+"', '"+emailformat+"')"
And in ‘EMAIL_ADMIN’ the value of ‘ADMIN_ENABLE’ field will be set to ‘N’
Note: In ‘ADMIN_ENABLE’ or ‘USER_ENABLE’ the value for enable is inserted as ‘Y’ else ‘N’.
In ‘EMAIL_FORMAT’ the value is inserted as ‘H’ for HTML and ‘T’ for TEXT.
When ‘EmailSess.jsp’ page is loaded it first read the ‘EMAIL_ADMIN’ and ‘EMAIL_USER’ by executing query as:
"select * from email_admin"
"select * from email_user"
And get the parameters ‘ADMIN_ENABLE’,’ADMIN_EMAILID’,’ EMAIL_FORMAT’ of ‘EMAIL_ADMIN’ table and ‘USER_ENABLE’,’EMAIL_FORMAT’ of ‘EMAIL_USER’ table and displayed while loading ‘EmailSess.jsp’.
Email Format
There are two radio buttons one is to set HTML image and other is to set TEXT image.
By default HTML Image will be loaded. While loading page it gets the values of ‘EMAIL_FORMAT’ and checks if first checkbox is enabled and second one is disabled then it reads from ‘EMAIL_ADMIN’ table, if second check box is enabled and first one is disabled then it reads email format of ‘EMAIL_USER’ table or if both the check boxes are enabled then the value of ‘EMAIL_FORMAT’ will remain same. When radio button is clicked then ‘fnEmailFormat()’ is called in JavaScript where conditions are checked for which radio button is clicked and depend on that image is loaded.
if(document.form1.chkEmailFormat[0].checked) { document.images[1].src = 'Images/HTML.jpg'; } if(document.form1.chkEmailFormat[1].checked) {
document.images[1].src='Images/TEXT.jpg'; }
Logout
When logout tab is clicked then JavaScript function invoke as javascript:fnConfirm() this is java scripts inbuilt function which is having ok and cancel button and having message “Are you Sure ?’.
If ok is clicked then URL is redirected to ‘index.jsp’ page.
Error Page
First the connection is made of reading ‘Arcmentor.ini’ file, if the entry is not there or connection is not able to make then the ‘ErrorPage.jsp’ gets loaded.
Base64
Library: Base64.jar
This file is included into lib directory. And imported as:
<%@page import=” com.base64.Base64”% >s4=new String(Base64.decode(s4));password=new String(Base64.encode(password));
Log4j
Library: log4j1.2.9.jar
Included to print error into log file. The library is included into lib directory.
In web.xml
<servlet> <servlet-name>Log4jInit</servlet-name>
<servlet-class>com.arcmentor.Log4jInit</servlet-class> <init-param> <param-name>log4j-init-file</param-name> <param-value>WEB-INF/classes/log4Arc.properties</param-value> </init-param> <init-param> <param-name>log4j-init-file1</param-name> <param-value>WEB-INF/classes/log4Arc1.properties</param-value> </init-param> <load-on-startup>1</load-on-startup></servlet>
Included as:
Java: import org.apache.log4j.Logger;
Logger logger;logger=Logger.getLogger("AdminManageCommand");
to print Statements:logger.debug(“-----");
to print exception:logger.error("Exception:"+e);
HTML: <%@ taglib uri="WEB-INF/tld/taglibs-log.tld" prefix="log" %>
<log:debug category="Status.jsp">---Entered Status.jsp---</log:debug>