com.adventnet.html.dynamic
Class HtmlCreation

java.lang.Object
  extended by com.adventnet.html.dynamic.HtmlCreation
All Implemented Interfaces:
HtmlInterface

public class HtmlCreation
extends java.lang.Object
implements HtmlInterface

In the case of HTTP communcation, the displayed html page can be generated in two ways.

          1. Dynamic Html Page generation.

          2. Customized Html Page generation using SSI tags.

In the first case the user don't need to type any html file for his instrumentation. The HtmlMain and DynamicHtml classes will generate dynamic html files and take care of all the necessary operations like modify value, create value, etc.

In the second case, using the .shtml files generated from the MibCompiler that contains required ssi tags to display the instrumented information, the user can customize the html pages.

This class is the common class to handle both type of html generation. The servlet should create an instance of this class and invoke corresponding functions from here.

See Also:
com.adventnet.ssiparser.HtmlParser, com.adventnet.ssiparser.DynamicHtml

Field Summary
(package private)  java.lang.String contextPath
           
 
Constructor Summary
HtmlCreation()
           
 
Method Summary
 void addHeaderInfo(java.lang.StringBuffer strBuf, java.lang.String mbeanName, java.lang.String url)
           
 void addStartHtmlTag(java.lang.StringBuffer strBuf)
           
 void closeHtmlTag(java.lang.StringBuffer strBuf)
           
 void createAboutUsHtmlFile(java.lang.StringBuffer strBuf)
          Creates the contents of the AboutUs File.
 void createAdminHtmlFile(java.lang.StringBuffer strBuf)
          Creates the contents of the Admin Page
 void createAttrbHtmlFile(java.lang.StringBuffer strBuf, java.util.Hashtable valTable, java.util.Vector varVect, java.util.Vector accessVect, java.util.Vector typeVect, java.lang.String objName, java.lang.String mbeanName, java.lang.String searchAttrbName, boolean addRow, boolean ischkBox, java.lang.String viewName)
          Creates the HTML file for attributes of array type.
 void createDeleteViewHtmlFile(java.lang.StringBuffer strBuf, java.util.Hashtable table)
           
 void createDomainIndexFile(java.lang.StringBuffer strBuf, java.lang.String domainName, java.util.Hashtable table)
          Displays the list of MBeans of a particular domain.
 void createFramesPage(java.lang.StringBuffer strBuf)
          Creates the main index file with frames.
 void createHashtableHtmlFile(java.lang.StringBuffer strBuf, java.lang.String mbeanName, java.lang.String objName, java.lang.String searchAttrbName, java.lang.String viewName, java.lang.Object obj)
           
 java.lang.String createHTMLForHashtable(java.util.Hashtable table)
           
 java.lang.String createHTMLForVector(java.util.Vector table, java.lang.String objName)
           
 void createIndexFile(java.lang.StringBuffer strBuf, java.lang.String file, java.util.Hashtable table, boolean isauthentication, boolean isAdminUser, java.util.Hashtable viewTable)
          Creates the contents of the index file in html format.
 void createListMBeansHtmlFile(java.lang.StringBuffer strBuf, java.util.Vector vect, java.lang.String viewname)
          Creates the contents of the all the MBeans that are registered with the MBeanServer.
 void createLoginHtmlFile(java.lang.StringBuffer strBuf, boolean flag)
          Creates the contents of the Login File.
 void createMainPage(java.lang.StringBuffer strBuf, java.util.Hashtable table, boolean isauthentication, boolean isAdminUser, java.util.Hashtable viewTable)
          Creates the contents of the MainPage.
 java.lang.String createNewRowFile(java.lang.StringBuffer strBuf, java.util.Vector varVect, java.util.Vector access, java.util.Vector type, java.util.Vector indexVect, java.lang.String mbeanName, java.lang.String objName, java.lang.String viewName)
          Creates the contents of the htmlfile when the addRow operation is performed.
 void createNewViewHtmlFile(java.lang.StringBuffer strBuf, java.util.Hashtable table)
          Creates the contents of the Creating a new view in Customize page.
 void createNotifHtmlFile(java.lang.StringBuffer strBuf, java.util.Vector varVect, java.util.ArrayList list, int stIndex, int endIndex)
          Creates the contents of the Notifications Page
 void createOperationResultHtmlFile(java.lang.StringBuffer strBuf, java.lang.String objName, java.lang.String operationName, java.lang.String viewName, boolean operResultFlag)
          Creates the contents of the Operations page.
 void createOperationsHtmlFile(java.lang.StringBuffer strBuf, java.lang.String objName, java.lang.String mbeanName, java.util.Hashtable table, java.lang.String viewName)
          Creates the contents of the Operations page.
 void createOperationsPageForValues(java.lang.StringBuffer strBuf, java.lang.String objName, java.lang.String actionName, java.lang.String mbeanName, java.lang.Object obj, java.lang.String[] sig, java.lang.String viewName, UserViewInterface userViewIntf)
          Creates the contents of the TopFrame.
 void createOptionsHtmlFile(java.lang.StringBuffer strBuf)
           
 void createPagePropertiesHtmlFile(java.lang.StringBuffer strBuf, java.util.Vector header)
           
 void createRegisterHtmlFile(java.lang.StringBuffer strBuf)
          Creates the contents of the RegisterMBean File.
 void createRegUnRegResultHtmlFile(java.lang.StringBuffer strBuf, int reg, boolean regResultFlag)
           
 void createScalarHtmlFile(java.lang.StringBuffer strBuf, java.lang.String objName, java.lang.String mbeanName, java.util.Vector header, java.util.Hashtable table, java.util.Hashtable domTable, java.lang.String viewName)
          Displays the list of Attributes of a particular MBean.
 void createSearchHtmlFile(java.lang.StringBuffer strBuf, java.util.Vector resultVec)
          Creates the contents of the Search Page
 void createSessionExpireHtmlFile(java.lang.StringBuffer strBuf)
           
 void createTableHtmlFile(java.lang.StringBuffer strBuf, java.util.Hashtable valTable, java.util.Hashtable table, java.util.Hashtable domTable, java.util.Vector vect, java.lang.String objName, java.lang.String mbeanName, int stIndex, int endIndex, int flag, java.lang.String viewName)
          Creates the contents of the html file that appears in Table format.
 void createTopFramePage(java.lang.StringBuffer strBuf)
          Creates the contents of the TopFrame.
 void createUnRegisterHtmlFile(java.lang.StringBuffer strBuf)
          Creates the contents of the UnRegisterMBean File.
 void createUserDefinedTypeHtmlFile(java.lang.StringBuffer strBuf, java.lang.String mbeanName, java.lang.String objName, java.lang.String searchAttrbName, java.lang.String viewName, java.lang.Object obj, java.lang.String type, UserViewInterface userViewIntf)
           
 void createUserInfoHtmlFile(java.lang.StringBuffer strBuf)
          Creates the contents of the UserInformations file.
 void createVectorHtmlFile(java.lang.StringBuffer strBuf, java.lang.String mbeanName, java.lang.String objName, java.lang.String searchAttrbName, java.lang.String viewName, java.lang.Object obj)
           
 void createViewForViewName(java.lang.StringBuffer strBuf, java.lang.String viewName, java.util.Vector vect)
           
 void createViewOptionsHtmlFile(java.lang.StringBuffer strBuf)
          Creates the contents of the Customize page.
 void setContextPath(java.lang.String src)
           
 void setHtmlPageProp(HtmlPageProp htmlPageProp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextPath

java.lang.String contextPath
Constructor Detail

HtmlCreation

public HtmlCreation()
Method Detail

setContextPath

public void setContextPath(java.lang.String src)

setHtmlPageProp

public void setHtmlPageProp(HtmlPageProp htmlPageProp)
Specified by:
setHtmlPageProp in interface HtmlInterface

addStartHtmlTag

public void addStartHtmlTag(java.lang.StringBuffer strBuf)

closeHtmlTag

public void closeHtmlTag(java.lang.StringBuffer strBuf)

addHeaderInfo

public void addHeaderInfo(java.lang.StringBuffer strBuf,
                          java.lang.String mbeanName,
                          java.lang.String url)

createIndexFile

public void createIndexFile(java.lang.StringBuffer strBuf,
                            java.lang.String file,
                            java.util.Hashtable table,
                            boolean isauthentication,
                            boolean isAdminUser,
                            java.util.Hashtable viewTable)
Creates the contents of the index file in html format. Depending on the file name passed, the corresponding methods namely createFramesPage, createTopFramesPage and createMainPage will be called.

Specified by:
createIndexFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.
file - the filename
table - It cofdntains all the list of domains that are registered with the MBeanServer
isauthentication - boolean true if authentication enable false otherwise.
isAdminUser - boolean true if Admin User false otherwise

createFramesPage

public void createFramesPage(java.lang.StringBuffer strBuf)
Creates the main index file with frames.

Parameters:
strBuf - to store the html tags that are generated

createTopFramePage

public void createTopFramePage(java.lang.StringBuffer strBuf)
Creates the contents of the TopFrame. The TopFrame

Parameters:
strBuf - to store the html tags that are generated

createMainPage

public void createMainPage(java.lang.StringBuffer strBuf,
                           java.util.Hashtable table,
                           boolean isauthentication,
                           boolean isAdminUser,
                           java.util.Hashtable viewTable)
Creates the contents of the MainPage. The MainPage displays all the MBeans that are registered with the MBeanServer.

Parameters:
strBuf - to store the html tags that are generated
table - It contains all the list of domains that are registered with the MBeanServer
isauthentication - boolean flag which tells whether the agent needs authentication or not.
isAdminUser - boolean flag which tells whether the user is a admin user or not

createDomainIndexFile

public void createDomainIndexFile(java.lang.StringBuffer strBuf,
                                  java.lang.String domainName,
                                  java.util.Hashtable table)
Displays the list of MBeans of a particular domain.

Specified by:
createDomainIndexFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
domainName - domain name for which the index needs to be generated.
table - hashtable which stores the details of registered MBeans under the respective domains.

createScalarHtmlFile

public void createScalarHtmlFile(java.lang.StringBuffer strBuf,
                                 java.lang.String objName,
                                 java.lang.String mbeanName,
                                 java.util.Vector header,
                                 java.util.Hashtable table,
                                 java.util.Hashtable domTable,
                                 java.lang.String viewName)
Displays the list of Attributes of a particular MBean.

Specified by:
createScalarHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
objName - a string representing the ObjectName of a particular MBean
mbeanName - is a string which is the name of the Mbean.
header - Vector which has the header variables to be displayed in the page like Attribute Value.
table - Hashtabel which contains the vectors name, type, access, description and value
domTable - which contains the list of domains.

createOperationsHtmlFile

public void createOperationsHtmlFile(java.lang.StringBuffer strBuf,
                                     java.lang.String objName,
                                     java.lang.String mbeanName,
                                     java.util.Hashtable table,
                                     java.lang.String viewName)
Creates the contents of the Operations page.

Specified by:
createOperationsHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
objName - the object name of the domain for which the operations are being created.
mbeanName - the name of the MBean for which the operations are being created
table - which contains the OperationName, ReturnType, ParamVector and ParamType vectors respectively

createOperationsPageForValues

public void createOperationsPageForValues(java.lang.StringBuffer strBuf,
                                          java.lang.String objName,
                                          java.lang.String actionName,
                                          java.lang.String mbeanName,
                                          java.lang.Object obj,
                                          java.lang.String[] sig,
                                          java.lang.String viewName,
                                          UserViewInterface userViewIntf)
Creates the contents of the TopFrame.

Specified by:
createOperationsPageForValues in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
objName - for which the operation page is created.
actionName - which specifies the operation name (get/set)
mbeanName - the name of the MbEan for which the page is generated.
obj - the return type of the operqation.
sig - an array of string.
viewName - the name of the View for a particular user

createHTMLForVector

public java.lang.String createHTMLForVector(java.util.Vector table,
                                            java.lang.String objName)

createHTMLForHashtable

public java.lang.String createHTMLForHashtable(java.util.Hashtable table)

createTableHtmlFile

public void createTableHtmlFile(java.lang.StringBuffer strBuf,
                                java.util.Hashtable valTable,
                                java.util.Hashtable table,
                                java.util.Hashtable domTable,
                                java.util.Vector vect,
                                java.lang.String objName,
                                java.lang.String mbeanName,
                                int stIndex,
                                int endIndex,
                                int flag,
                                java.lang.String viewName)
Creates the contents of the html file that appears in Table format.

Specified by:
createTableHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
valTable - hashtable which has the values of the rows according to key value index.
table - hashtable which gets the vector for variable, type, access and indexes names.
domTable - hashtable which contains the other domian names.
vect - vector which contains the indexes list.
objName - the object name of the table.
mbeanName - the name of the MBean for which the table belongs.
stIndex - the first index of the row displayed
endIndex - the last index of the row displayed
flag - which indicates whether prev, next contextPath/images to be present or not.

createUserDefinedTypeHtmlFile

public void createUserDefinedTypeHtmlFile(java.lang.StringBuffer strBuf,
                                          java.lang.String mbeanName,
                                          java.lang.String objName,
                                          java.lang.String searchAttrbName,
                                          java.lang.String viewName,
                                          java.lang.Object obj,
                                          java.lang.String type,
                                          UserViewInterface userViewIntf)
Specified by:
createUserDefinedTypeHtmlFile in interface HtmlInterface

createHashtableHtmlFile

public void createHashtableHtmlFile(java.lang.StringBuffer strBuf,
                                    java.lang.String mbeanName,
                                    java.lang.String objName,
                                    java.lang.String searchAttrbName,
                                    java.lang.String viewName,
                                    java.lang.Object obj)
Specified by:
createHashtableHtmlFile in interface HtmlInterface

createVectorHtmlFile

public void createVectorHtmlFile(java.lang.StringBuffer strBuf,
                                 java.lang.String mbeanName,
                                 java.lang.String objName,
                                 java.lang.String searchAttrbName,
                                 java.lang.String viewName,
                                 java.lang.Object obj)
Specified by:
createVectorHtmlFile in interface HtmlInterface

createAttrbHtmlFile

public void createAttrbHtmlFile(java.lang.StringBuffer strBuf,
                                java.util.Hashtable valTable,
                                java.util.Vector varVect,
                                java.util.Vector accessVect,
                                java.util.Vector typeVect,
                                java.lang.String objName,
                                java.lang.String mbeanName,
                                java.lang.String searchAttrbName,
                                boolean addRow,
                                boolean ischkBox,
                                java.lang.String viewName)
Creates the HTML file for attributes of array type.

Specified by:
createAttrbHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
valTable - hashtable which has the row values for each indexes.
varVect - the vector which contains the variables list.
accessVect - the vector which contains the access type.
typeVect - the vector which contains the type of the variable.
objName - the object name of the Mbean for which the table is displayed
mbeanName - the name of the MBean.
searchAttrbName - the attribute for which the values are displayed.
addRow - the flag which specifies the addRow button has to be added or not.
ischkBox - the flag which specifies whether the check box has the displayed for each row.

createNewRowFile

public java.lang.String createNewRowFile(java.lang.StringBuffer strBuf,
                                         java.util.Vector varVect,
                                         java.util.Vector access,
                                         java.util.Vector type,
                                         java.util.Vector indexVect,
                                         java.lang.String mbeanName,
                                         java.lang.String objName,
                                         java.lang.String viewName)
Creates the contents of the htmlfile when the addRow operation is performed.

Specified by:
createNewRowFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.
varVect - vector which contains the the variable names.
access - the access type for each variable.
type - the data type for each of the variable.
indexVect - the vector which contains the names of the index.
mbeanName - The Name of the MBean for which the new row file is displayed.
objName - the object name of the MBean which it is displayed.

createNotifHtmlFile

public void createNotifHtmlFile(java.lang.StringBuffer strBuf,
                                java.util.Vector varVect,
                                java.util.ArrayList list,
                                int stIndex,
                                int endIndex)
Creates the contents of the Notifications Page

Specified by:
createNotifHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.
varVect - the vector which displays the header for the table to be displayed.
list - the array list containing the notification values.
stIndex - specifies the Start Index
endIndex - specifies the End Index

createSearchHtmlFile

public void createSearchHtmlFile(java.lang.StringBuffer strBuf,
                                 java.util.Vector resultVec)
Creates the contents of the Search Page

Specified by:
createSearchHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.
resultVec - a vector which stores the results of the search operation

createAdminHtmlFile

public void createAdminHtmlFile(java.lang.StringBuffer strBuf)
Creates the contents of the Admin Page

Specified by:
createAdminHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.

createRegisterHtmlFile

public void createRegisterHtmlFile(java.lang.StringBuffer strBuf)
Creates the contents of the RegisterMBean File.

Specified by:
createRegisterHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.

createUnRegisterHtmlFile

public void createUnRegisterHtmlFile(java.lang.StringBuffer strBuf)
Creates the contents of the UnRegisterMBean File.

Specified by:
createUnRegisterHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.

createAboutUsHtmlFile

public void createAboutUsHtmlFile(java.lang.StringBuffer strBuf)
Creates the contents of the AboutUs File.

Specified by:
createAboutUsHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.

createLoginHtmlFile

public void createLoginHtmlFile(java.lang.StringBuffer strBuf,
                                boolean flag)
Creates the contents of the Login File.

Specified by:
createLoginHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.
flag - which specifes whether the page should lead to main page or index page.

createUserInfoHtmlFile

public void createUserInfoHtmlFile(java.lang.StringBuffer strBuf)
Creates the contents of the UserInformations file.

Specified by:
createUserInfoHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the generated tags information.

createNewViewHtmlFile

public void createNewViewHtmlFile(java.lang.StringBuffer strBuf,
                                  java.util.Hashtable table)
Creates the contents of the Creating a new view in Customize page. This page lists all the domains that are registered with the MBeanServer.

Specified by:
createNewViewHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
table - It contains all the list of domains that are registered with the MBeanServer

createViewOptionsHtmlFile

public void createViewOptionsHtmlFile(java.lang.StringBuffer strBuf)
Creates the contents of the Customize page. This page has the links to create a new customized view, delete an existing view and renaming views that are already created.

Specified by:
createViewOptionsHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated

createListMBeansHtmlFile

public void createListMBeansHtmlFile(java.lang.StringBuffer strBuf,
                                     java.util.Vector vect,
                                     java.lang.String viewname)
Creates the contents of the all the MBeans that are registered with the MBeanServer.

Specified by:
createListMBeansHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
vect - It contains all the list of MBeans for the selected domains while creating a view.
viewname - A name that is given for the view.

createViewForViewName

public void createViewForViewName(java.lang.StringBuffer strBuf,
                                  java.lang.String viewName,
                                  java.util.Vector vect)
Specified by:
createViewForViewName in interface HtmlInterface

createDeleteViewHtmlFile

public void createDeleteViewHtmlFile(java.lang.StringBuffer strBuf,
                                     java.util.Hashtable table)
Specified by:
createDeleteViewHtmlFile in interface HtmlInterface

createPagePropertiesHtmlFile

public void createPagePropertiesHtmlFile(java.lang.StringBuffer strBuf,
                                         java.util.Vector header)
Specified by:
createPagePropertiesHtmlFile in interface HtmlInterface

createOptionsHtmlFile

public void createOptionsHtmlFile(java.lang.StringBuffer strBuf)
Specified by:
createOptionsHtmlFile in interface HtmlInterface

createOperationResultHtmlFile

public void createOperationResultHtmlFile(java.lang.StringBuffer strBuf,
                                          java.lang.String objName,
                                          java.lang.String operationName,
                                          java.lang.String viewName,
                                          boolean operResultFlag)
Description copied from interface: HtmlInterface
Creates the contents of the Operations page.

Specified by:
createOperationResultHtmlFile in interface HtmlInterface
Parameters:
strBuf - to store the html tags that are generated
objName - the object name of the domain for which the operations are being created.
operationName - the name of the View for a particular user
operResultFlag - flag which describes whether the operation is successful or not.

createRegUnRegResultHtmlFile

public void createRegUnRegResultHtmlFile(java.lang.StringBuffer strBuf,
                                         int reg,
                                         boolean regResultFlag)
Specified by:
createRegUnRegResultHtmlFile in interface HtmlInterface

createSessionExpireHtmlFile

public void createSessionExpireHtmlFile(java.lang.StringBuffer strBuf)
Specified by:
createSessionExpireHtmlFile in interface HtmlInterface