Index: /branches/rel_ag_9_4_5/webui/proxy/new/inc/class.anLib_pageTree.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/inc/class.anLib_pageTree.php	(revision 20341)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/inc/class.anLib_pageTree.php	(working copy)
@@ -1226,7 +1226,7 @@
 						$this->addpage('vRoleSelectAuthMethod', 'incVirtual/role/class.anPage_vRole.php', $this->currentNode[NODE_TAB], array(array(), array('policy'), "site", array('role')));
 						$this->addpage('vRoleAddLdapUser', 'incVirtual/role/class.anPage_vRole.php', $this->currentNode[NODE_TAB], array(array(), array('policy'), "site", array('role')));
 						$this->addpage('vRoleAddLdapGroup', 'incVirtual/role/class.anPage_vRole.php', $this->currentNode[NODE_TAB], array(array(), array('policy'), "site", array('role')));
-						
+						$this->addpage('vRoleAddSamlGroup', 'incVirtual/role/class.anPage_vRole.php', $this->currentNode[NODE_TAB], array(array(), array('policy'), "site", array('role')));
 
 				//====================================================
 				// VIRUTAL SITE->ROLE->ROLE RESOURCE
Index: /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/chinese.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/chinese.php	(revision 20341)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/chinese.php	(working copy)
@@ -5736,10 +5736,12 @@
 	'ssl_certificate_type_sm2' => 'SM2',
 	'add_from_ldb' => '从LocalDB添加',
 	'add_from_ldap' => '从LDAP添加',
+	'add_from_saml' => '从SAML添加',
 	'add_user_from_ldap' => '从LDAP添加用户',
 	'add_group_from_ldap' => '从LDAP添加组',
 	'add_user_from_ldb' => '从LocalDB添加用户',
 	'add_group_from_ldb' => '从LocalDB添加组',
+	'add_group_from_saml' => '从SAML添加组',
 	'select_or_add_ldap' => '添加自',
 	'add_from_existing_ldap' => '已定义的LDAP主机',
 	'add_from_new_ldap' => '新的LDAP主机',
Index: /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/default.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/default.php	(revision 20341)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/default.php	(working copy)
@@ -4122,10 +4122,12 @@
 	'ssl_certificate_type_sm2' => 'SM2',
 	'add_from_ldb' => 'Add From LocalDB',
 	'add_from_ldap' => 'Add From LDAP',
+	'add_from_saml' => 'Add From SAML',
 	'add_user_from_ldap' => 'Add Users from LDAP',
 	'add_group_from_ldap' => 'Add Groups from LDAP',
 	'add_user_from_ldb' => 'Add Users from LocalDB',
 	'add_group_from_ldb' => 'Add Groups from LocalDB',
+	'add_group_from_saml' => 'Add Groups from SAML',
 	'select_or_add_ldap' => 'Add From',
 	'add_from_existing_ldap' => 'An existing LDAP host',
 	'add_from_new_ldap' => 'A new LDAP host',
Index: /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/japanese.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/japanese.php	(revision 20341)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/japanese.php	(working copy)
@@ -5632,10 +5632,12 @@
 	'ssl_certificate_type_sm2'  => 'SM2',
 	'add_from_ldb' => 'LocalDBから追加',
 	'add_from_ldap' => 'LDAPから追加',
+	'add_from_saml' => 'SAMLから追加',
 	'add_user_from_ldap' => 'LDAPからユーザを追加',
 	'add_group_from_ldap' => 'LDAPからグループを追加',
 	'add_user_from_ldb' => 'LocalDBからユーザを追加',
 	'add_group_from_ldb' => 'LocalDBからグループを追加',
+	'add_group_from_saml' => 'SAMLからグループを追加',
 	'select_or_add_ldap' => '追加元',
 	'add_from_existing_ldap' => '既存LDAPホスト',
 	'add_from_new_ldap' => '新規LDAPホスト',
Index: /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/traditional_chinese.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/traditional_chinese.php	(revision 20341)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/inc/language/traditional_chinese.php	(working copy)
@@ -5736,10 +5736,12 @@
 	'ssl_certificate_type_sm2' => 'SM2',
 	'add_from_ldb' => '從LocalDB新增',
 	'add_from_ldap' => '從LDAP新增',
+	'add_from_saml' => '從SAML新增',
 	'add_user_from_ldap' => '從LDAP新增使用者',
 	'add_group_from_ldap' => '從LDAP新增群組',
 	'add_user_from_ldb' => '從LocalDB新增使用者',
 	'add_group_from_ldb' => '從LocalDB新增群組',
+	'add_group_from_saml' => '從SAML新增群組',
 	'select_or_add_ldap' => '新增自',
 	'add_from_existing_ldap' => '已定義的LDAP主機',
 	'add_from_new_ldap' => '新的LDAP主機',
Index: /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.anPage_vRole.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.anPage_vRole.php	(revision 20341)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.anPage_vRole.php	(working copy)
@@ -79,6 +79,16 @@
 			$_SESSION['currentPageId'] = 'vRoleQualification';
 		}
 		break;
+	case 'vRoleAddSamlGroup':
+		if (pilot::getMode(1) == 'config') {
+		// Admin must be in 'config' mode in order to access these pages...
+			require_once('incVirtual/role/class.cliWrap_vRoleAddSamlGroup.php'); 
+		} else {
+		// If admin is not in 'config' mode, return to parent page
+			require_once('incVirtual/role/class.cliWrap_vRoleQualification.php'); 
+			$_SESSION['currentPageId'] = 'vRoleQualification';
+		}
+		break;
 	case 'vRoleSelectAuthMethod':
 		if (pilot::getMode(1) == 'config') {
 		// Admin must be in 'config' mode in order to access these pages...
@@ -193,6 +203,18 @@
 					}
 				}
 				break;
+			case 'vRoleAddSamlGroup':
+				$vRoleAddSamlGroup = anLib_baseCliWrapper::getSingleton('cliWrap_vRoleAddSamlGroup');
+				if ($vRoleAddSamlGroup->getActionResult() == 'redirect') {
+					pilot::setSessionData('currentPageId', 'vRoleAddQualification');
+					require_once('incVirtual/role/class.cliWrap_vRoleAddQualification.php'); 
+					$vRoleQualification = anLib_baseCliWrapper::getSingleton('cliWrap_vRoleAddQualification');
+					$t_jsOnLoadEnd = $vRoleAddSamlGroup->getActionResult(1);
+					if (!empty($t_jsOnLoadEnd)) {
+						$this->jsOnLoadEnd .= $t_jsOnLoadEnd;
+					}
+				}
+				break;
 			case 'vRoleSelectAuthMethod':
 				$vRoleSelectAuthMethod = anLib_baseCliWrapper::getSingleton('cliWrap_vRoleSelectAuthMethod');
 				if ($vRoleSelectAuthMethod->getActionResult() == 'redirect') {
@@ -249,6 +271,9 @@
 			case 'vRoleAddLdapGroup':
 				$this->syncWithCliWrapper($vRoleAddLdapGroup);
 				break;
+			case 'vRoleAddSamlGroup':
+				$this->syncWithCliWrapper($vRoleAddSamlGroup);
+				break;
 			case 'vRoleSelectAuthMethod':
 				$this->syncWithCliWrapper($vRoleSelectAuthMethod);
 				break;
Index: /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleAddQualification.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleAddQualification.php	(revision 20341)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleAddQualification.php	(working copy)
@@ -409,7 +409,8 @@
 										'maxlength="496" size="64"', //511-15
 										'<input type="button" onclick="addCond(\'userandgroup\');" value="'.language::translate('add').'" />
 										<input type="button" onclick="addFromLocalDB();" value="'.language::translate('add_from_ldb').'" />
-										<input type="button" onclick="addFromLDAP();" value="'.language::translate('add_from_ldap').'" />',
+										<input type="button" onclick="addFromLDAP();" value="'.language::translate('add_from_ldap').'" />
+                                        <input type="button" onclick="addFromSAML();" value="'.language::translate('add_from_saml').'" />',
 										STRING_INPUT);
 
 				$this->mainContent .= anLib_htmlCode::cliWrap_rowFootnoteBox('_LOGINYEAR_msg', $this, array(array('note', language::translate('role_cond_year_msg'))));
@@ -793,6 +794,33 @@
 				}
 			}
 
+			function addFromSAML () {
+				if (document.forms["form_mainView"].actionStr.value == "") {
+					var page_id = "";
+					var type = document.forms["form_mainView"].' . $this->classId . '_condition_type.value;
+
+					if (type == "GROUPNAME") {
+						page_id = "vRoleAddSamlGroup";
+					} else {
+						return;
+					}
+
+					document.forms["form_mainView"].' . $this->classId . '_s_role_name.value = document.forms["form_mainView"].' . $this->classId . '_role_name.value;
+					document.forms["form_mainView"].' . $this->classId . '_s_quali_name.value = document.forms["form_mainView"].' . $this->classId . '_quali_name.value;
+					document.forms["form_mainView"].' . $this->classId . '_s_quali_desc.value = document.forms["form_mainView"].' . $this->classId . '_quali_desc.value;
+					document.forms["form_mainView"].' . $this->classId . '_s_condition_content_userandgroup.value = document.forms["form_mainView"].' . $this->classId . '_condition_content_userandgroup.value;
+					document.forms["form_mainView"].' . $this->classId . '_s_condition_type.value = document.forms["form_mainView"].' . $this->classId . '_condition_type.value;
+					document.forms["form_mainView"].' . $this->classId . '_s_condition_action.value = document.forms["form_mainView"].' . $this->classId . '_condition_action.value;
+
+					saveCond();
+					hideSPMessage ();
+					document.forms["form_mainView"].target = "mainView";
+					formAction_setPage(page_id);
+				} else {
+					document.forms["form_mainView"].submit();
+				}
+			}
+
 			';
 	}
 	
@@ -884,4 +912,4 @@
     	}    					
 	}
 }
-?>
+?>
Index: /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleAddSamlGroup.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleAddSamlGroup.php	(revision 0)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleAddSamlGroup.php	(working copy)
@@ -0,0 +1,526 @@
+<?PHP
+/*************************************************************************
+*
+* Copyright Notice
+*
+* (c) 2006 ArrayNetworks All Rights Reserved
+*
+* @author - shuinvyc
+* @package - ArrayNeworks CLI Wrapper Library
+*
+*************************************************************************/
+
+
+// ========================================================================
+// INCLUDE CLASS DEPENDANCIES
+// ========================================================================
+require_once('inc/class.anLib_baseCliWrapper.php');
+require_once('cli_define.inc');
+
+/*************************************************************************
+*
+* WRAPPER FOR CLI COMMANDS:
+* show aaa saml config
+*
+* PUBLIC FUNCTIONS:
+*
+* cliWrap_vRoleAddSamlGroup ($in_classId)
+*
+* PRIVATE FUNCTIONS:
+*
+* setMainContent ()
+* setFormContent ()
+* setJsAppend ()
+* setJsOnLoadStart ()
+* setJsOnLoadEnd ()
+* setCSSAppend ()
+* setJsOnResetAppend ()
+* setJsOnSaveAppend ()
+* getSAMLGroupNames ()
+*
+*************************************************************************/
+class cliWrap_vRoleAddSamlGroup extends anLib_baseCliWrapper {
+
+    // ------------------------------------------------------------
+    // Class variables
+    // ------------------------------------------------------------
+    var $groupArr;
+    var $strictSAMLViewMode;
+    var $configuration;
+
+    /********************************************************************
+    *
+    * Constructor
+    *
+    * $param    string - class id
+    * @return   void
+    *
+    ********************************************************************/
+    function cliWrap_vRoleAddSamlGroup ($in_classId) { 
+        $this->classId = $in_classId;
+
+        // ------------------------------------------------------------
+        // Check overall authorization based on license and role
+        // requirements.  This authorization point checks against a
+        // merged policy based on all licenses and role features used
+        // in this particular CLI wrapper.  The results are stored in
+        // the 'viewMode' class variable.  For more granular behavior,
+        // the developer must implement the pilot::cliCmdAuthorization
+        // function on a case by case basis throughout the rest of the
+        // code.
+        // ------------------------------------------------------------
+        $this->viewMode = pilot::cliCmdAuthorization('','policy', 'site', 'role');
+        $this->strictSAMLViewMode = pilot::cliCmdAuthorization('','policy', 'site', 'role');
+        if (($this->viewMode == CLI_HIDE)
+          && ($this->strictSAMLViewMode == CLI_HIDE)) {
+        // Group is not currently authorized to access this cli wrapper...must exit.
+            return;
+        } else if ($this->strictSAMLViewMode == CLI_CONFIG) {
+            $this->viewMode = CLI_CONFIG;
+        }
+        if ($this->viewMode == CLI_HIDE) {
+            $this->viewMode = CLI_ENABLE;
+        }
+
+        // ------------------------------------------------------------
+        // Initialize content strings
+        // ------------------------------------------------------------
+        $this->mainContent = '';
+        $this->formContent = '';
+        $this->jsAppend = '';
+        $this->jsOnLoadStart = '';
+        $this->jsOnLoadEnd = '';
+        $this->cssAppend = '';
+        $this->jsOnResetAppend = '';
+        $this->jsOnSaveAppend = '';
+        $this->htmlSectionHeaderBtns = '';
+        $this->htmlSectionHeaderBtns2 = '';
+        $this->groupArr = array();
+        $this->configuration = '';
+        // ------------------------------------------------------------
+        // Check for submission of form.  Process form as necessary.
+        // ------------------------------------------------------------
+        $t_actionStrArr = explode(',', $_POST['actionStr']);
+        while (list($key, $data) = each($t_actionStrArr)) {
+            switch($data) {
+                case ($this->classId . '_search'):
+                    pilot::setSessionData('searchByName', $_POST[$this->classId . 'searchByName']);
+                    break;
+
+                default:
+                    break;
+            }
+        }
+        // ------------------------------------------------------------
+        // Build main content object (Uncomment/comment as necessary)
+        // ------------------------------------------------------------
+}
+
+    /********************************************************************
+    *
+    * Create main HTML content for the respective CLI command
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setMainContent () {
+        global $g_tabIndex; // Use to assign tab index order
+        // ------------------------------------------------------------
+        // Pagination support
+        // ------------------------------------------------------------
+        pilot::setSessionData('rowMax', 100);
+
+        // ------------------------------------------------------------
+        // CLI DATA:  get all aaa saml data
+        // ------------------------------------------------------------
+
+        $search_name = urldecode(pilot::getSessionData('searchByName'));
+        if (empty($search_name)) {
+            $search_name = "";
+        }
+        $CMD_SHOW_AAA_SAML_CONFIG = "show aaa saml config";
+        $t_cliResp = cli::exec_direct($CMD_SHOW_AAA_SAML_CONFIG);
+        if ($t_cliResp->result != 1) {
+            $t_errStr = cli::get_reason_info($t_cliResp);
+            $this->jsOnLoadEnd .= 'g_errStr += "' . (urldecode(str_replace('%0A', '\n', urlencode(addslashes($t_errStr))))) . '";';
+        }
+        // Only the pattern start with "aaa saml idp attributes" is what we need
+        $saml_group_info = $this->getSAMLGroupNames($t_cliResp->content, $search_name);
+        // ------------------------------------------------------------
+        // CLI DATA:  list of group accounts
+        // ------------------------------------------------------------
+        // Calculate the minimum and maximum page index values
+        pilot::setSessionData('rowTotal', (integer)count($saml_group_info));
+        $t_pageIndexMin = 1;
+        $t_pageIndexMax = (integer)((pilot::getSessionData('rowTotal') + pilot::getSessionData('rowMax') - 1)/pilot::getSessionData('rowMax'));
+        // If current page index is out of scope then set to $t_pageIndexMin
+        if ((pilot::getSessionData('a_pageIndex') < $t_pageIndexMin)
+            || (pilot::getSessionData('a_pageIndex') > $t_pageIndexMax)) {
+            pilot::setSessionData('a_pageIndex', $t_pageIndexMin);
+        }
+
+        pilot::setSessionData('pageIndexStart', $t_pageIndexMin);
+        if (pilot::getSessionData('pageIndexStart') < $t_pageIndexMin) {
+            pilot::setSessionData('pageIndexStart', $t_pageIndexMin);
+        }
+        pilot::setSessionData('pageIndexEnd', $t_pageIndexMax);
+        if (pilot::getSessionData('pageIndexEnd') > $t_pageIndexMax) {
+            pilot::setSessionData('pageIndexEnd', $t_pageIndexMax);
+        }
+
+        pilot::setSessionData('rowStart', 1 + ((pilot::getSessionData('a_pageIndex') - 1) * pilot::getSessionData('rowMax')));
+        pilot::setSessionData('rowEnd', pilot::getSessionData('rowStart') + pilot::getSessionData('rowMax') - 1);
+
+
+        if (pilot::getSessionData('rowEnd') > pilot::getSessionData('rowTotal')) {
+            pilot::setSessionData('rowEnd', pilot::getSessionData('rowTotal'));
+        }
+
+        $t_cliResp = cli::exec_direct($CMD_SHOW_AAA_SAML_CONFIG, $search_name, "", 
+                pilot::getSessionData('rowStart'), pilot::getSessionData('rowMax'), 'G', "G");
+        if ($t_cliResp->result != 1) {
+            $t_errStr = cli::get_reason_info($t_cliResp);
+            $this->jsOnLoadEnd .= 'g_errStr += "' . (urldecode(str_replace('%0A', '\n', urlencode(addslashes($t_errStr))))) . '";';
+        }
+        $this->groupArr = $this->getSAMLGroupNames($t_cliResp->content, $search_name);
+        // ------------------------------------------------------------
+        // CHECK VIEW MODE:  section header buttons
+        // ------------------------------------------------------------
+        switch ($this->viewMode) {
+            case CLI_CONFIG:
+                $this->htmlSectionHeaderBtns = '<B><A href="javascript:cancel_group();">' . language::translate('cancel') . '</A>';
+                $this->htmlSectionHeaderBtns .= ' | <A href="javascript:add_group();">' . language::translate('select_ok') . '</A></B>';
+                break;
+            case CLI_ENABLE:
+            case CLI_HIDE:
+            default:
+                break;
+        }
+
+        $this->mainContent .= anLib_htmlCode::pageSectionStart('add_group_from_saml', 1, $this->htmlSectionHeaderBtns);
+        $this->mainContent .= anLib_htmlCode::cliWrap_startTable();
+        // ------------------------------------------------------------
+        // Call content function based on group's current mode
+        // ------------------------------------------------------------
+        switch ($this->viewMode) {
+            case CLI_ENABLE:
+            case CLI_CONFIG:
+                $t_restoreViewMode = $this->viewMode;
+                $this->viewMode = CLI_CONFIG;
+                $this->mainContent .= '<TR><TD nowrap>';
+                $this->mainContent .= anLib_htmlCode::greyBox ('footnoteSearch', $this, array(array('footnote', 'Search By Name:  ' . anLib_htmlCode::textField('searchByName', $this, urldecode(pilot::getSessionData('searchByName')), $g_tabIndex++, '') . ' ' . anLib_htmlCode::regularBtn('_search_btn', $this, language::translate('search'), $g_tabIndex++, 'onclick="onClickSearch();"') . '')));
+                $this->mainContent .= '</TD></TR>';
+                $this->viewMode = $t_restoreViewMode;
+
+                // ACTIVEWIDGET TABLE:  group accounts
+                $this->mainContent .= '<TR><TD>';
+                $this->mainContent .= '
+                    <SCRIPT language="javascript" type="text/javascript">
+                        document.write(grid_accounts);
+                    </script>
+                ';
+                $this->mainContent .= '</TD></TR>';
+
+                // PAGINATION
+                if (pilot::getSessionData('rowTotal') > pilot::getSessionData('rowMax')) {
+                    $this->mainContent .= '<TR><TD id="pagination" nowrap style="text-align: center" class="pagination">';
+                    $this->mainContent .= '<SPAN id="pageResult">Result ' . pilot::getSessionData('rowStart') . '-' . pilot::getSessionData('rowEnd') . ' of ' . pilot::getSessionData('rowTotal') . '</SPAN>:&nbsp;&nbsp;';
+
+                    if (pilot::getSessionData('a_pageIndex') != 1) {
+                        $this->mainContent .= '<SPAN id="pageIndex_previous" style="display: inline; font-weight: bold;color:#FFFFFF;">&nbsp;<A href="javascript: setPageIndex(g_pageIndex - 1);">Previous</A>&nbsp;</SPAN>';
+                    } else {
+                        $this->mainContent .= '<SPAN id="pageIndex_previous" style="display: none; font-weight: bold;color:#FFFFFF;">&nbsp;<A href="javascript: setPageIndex(g_pageIndex - 1);">Previous</A>&nbsp;</SPAN>';
+                    }
+
+                    $t_pageIndexMax = (integer)((pilot::getSessionData('rowTotal') + pilot::getSessionData('rowMax') - 1)/pilot::getSessionData('rowMax'));
+                    $t_pageIndexStart = pilot::getSessionData('a_pageIndex') - 9;
+                    if ($t_pageIndexStart < 1) {
+                        $t_pageIndexStart = 1;
+                    }
+                    $t_pageIndexEnd = pilot::getSessionData('a_pageIndex') + 9;
+                    if ($t_pageIndexEnd > $t_pageIndexMax) {
+                        $t_pageIndexEnd = $t_pageIndexMax;
+                    }
+                    for ($i = $t_pageIndexStart; $i <= $t_pageIndexEnd; $i++) {
+                        if ($i == pilot::getSessionData('a_pageIndex')) {
+                            $this->mainContent .= '<SPAN id="pageIndex_' . $i . '" style="font-weight: bold; background-color:#989889;color:#FFFFFF;">&nbsp;' . $i . '&nbsp;</span>';
+                        } else {
+                            $this->mainContent .= '<SPAN id="pageIndex_' . $i . '" style="font-weight: bold;color:#FFFFFF;">&nbsp;<A href="javascript: setPageIndex(' . $i . ');">' . $i . '</A>&nbsp;</SPAN>';
+                        }
+                    }
+                    if (pilot::getSessionData('a_pageIndex') < $t_pageIndexMax) {
+                        $this->mainContent .= '<SPAN id="pageIndex_next" style="display: inline; font-weight: bold;color:#FFFFFF;">&nbsp;<A href="javascript: setPageIndex(g_pageIndex + 1);">Next</A>&nbsp;</SPAN>';
+                    } else {
+                        $this->mainContent .= '<SPAN id="pageIndex_next" style="display: none; font-weight: bold;color:#FFFFFF;">&nbsp;<A href="javascript: setPageIndex(g_pageIndex + 1);">Next</A>&nbsp;</SPAN>';
+                    }
+                    $this->mainContent .= '</TD></TR>';
+                }
+
+                break;
+            case CLI_HIDE:
+            default:
+                // Should not normally reach this case
+                $this->mainContent .= '<TR><TD>' . language::translate('debug_unexpectedErrorIn') . $this->classId . '</TD></TR>';
+                break;
+        }
+        $this->mainContent .= anLib_htmlCode::cliWrap_endTable();
+        $this->mainContent .= anLib_htmlCode::pageSectionEnd();
+    }
+
+    /********************************************************************
+    *
+    *  Create extra <INPUT> tags for form submission
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setFormContent () {
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_s_role_name" value="'.$_POST['cliWrap_vRoleAddQualification_s_role_name'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_s_quali_name" value="'.$_POST['cliWrap_vRoleAddQualification_s_quali_name'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_s_quali_desc" value="'.$_POST['cliWrap_vRoleAddQualification_s_quali_desc'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_edit" value="'.$_POST['cliWrap_vRoleAddQualification_edit'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_q_old" value="'.$_POST['cliWrap_vRoleAddQualification_q_old'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_d_old" value="'.$_POST['cliWrap_vRoleAddQualification_d_old'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_edit_old" value="'.$_POST['cliWrap_vRoleAddQualification_edit_old'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_is_edit" value="'.$_POST['cliWrap_vRoleAddQualification_is_edit'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_c_list" value="'.$_POST['cliWrap_vRoleAddQualification_c_list'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_s_condition_content_select" value="'.$_POST['cliWrap_vRoleAddQualification_s_condition_content_select'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_s_condition_type" value="'.$_POST['cliWrap_vRoleAddQualification_s_condition_type'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_s_condition_action" value="'.$_POST['cliWrap_vRoleAddQualification_s_condition_action'].'">';
+        $this->formContent .= '<INPUT type="hidden" name="cliWrap_vRoleAddQualification_save" value="save">';
+    }
+
+    /********************************************************************
+    *
+    * Add supporting javascript code to be appended at the end of 
+    * the <SCRIPT></SCRIPT> container
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setJsAppend () {
+        // ------------------------------------------------------------
+        // Build group account grid table
+        // ------------------------------------------------------------
+        // Declare grid table column headers
+        $this->jsAppend .= '
+            // ------------------------------------------------------------
+            // Pagination support
+            // ------------------------------------------------------------
+            var g_rowMax = ' . pilot::getSessionData('rowMax') . ';
+            var g_pageIndex = ' . pilot::getSessionData('a_pageIndex') . ';
+            var g_pageIndexStart = ' . pilot::getSessionData('pageIndexStart') . ';
+            var g_pageIndexEnd = ' . pilot::getSessionData('pageIndexEnd') . ';
+            var g_pageIndexOld = ' . pilot::getSessionData('a_pageIndex') . ';
+            var g_rowStart = ' . pilot::getSessionData('rowStart') . ';
+            var g_rowEnd = ' . pilot::getSessionData('rowEnd') . ';
+            var g_rowTotal = ' . pilot::getSessionData('rowTotal') . ';
+            var g_pageIndexMax = ' . (integer)((pilot::getSessionData('rowTotal') + pilot::getSessionData('rowMax') - 1)/pilot::getSessionData('rowMax')) . ';
+            ';
+        $this->jsAppend .= '
+            var accountGridHeaders = [
+                "' . language::translate('group_name') . '"
+            ];';
+
+        // Declare text (e.g. for HTML display) and value (e.g. for sorting or CLI parameters) arrays
+        $t_jsAppend = 'var accountDataValue = [';
+        $this->jsAppend .= 'var accountDataText = [';
+        $t_keyMin = (pilot::getSessionData('pageIndexStart') - 1) * pilot::getSessionData('rowMax');
+        foreach ($this->groupArr as $t_data) {
+            $this->jsAppend .= '["' . helper::makeHTMLSafe($t_data) . '"],';
+            $t_jsAppend .= '["' . helper::makeFormSafe($t_data) . '"],';
+        }
+        $this->jsAppend .= '];';
+        $t_jsAppend .= '];';
+        $this->jsAppend .= $t_jsAppend;
+        $this->jsAppend .= 'var g_rowOffset = ' . $t_keyMin . ';';
+
+        // Instantiate and configure style for grid table
+        $this->jsAppend .= '
+            var grid_accounts = new AW.UI.Grid;
+            grid_accounts.setId("grid_accounts");
+            grid_accounts.setVirtualMode(false);
+            grid_accounts.setColumnCount(1);
+            grid_accounts.setRowCount(' . (pilot::getSessionData('a_pageIndex') == pilot::getSessionData('pageIndexEnd') ? 
+                                                (((pilot::getSessionData('rowTotal')%pilot::getSessionData('rowMax')) == 0) && (pilot::getSessionData('rowTotal') != 0) ? pilot::getSessionData('rowMax') : (pilot::getSessionData('rowTotal')%pilot::getSessionData('rowMax')))
+                                                :((pilot::getSessionData('rowTotal') < pilot::getSessionData('rowMax')) ? pilot::getSessionData('rowTotal') : pilot::getSessionData('rowMax')))  
+                                                . ');
+            grid_accounts.setHeaderText(accountGridHeaders);
+            grid_accounts.setCellText(accountDataText);
+            grid_accounts.setCellValue(accountDataValue);
+            grid_accounts.setSelectorVisible(true);
+            grid_accounts.setSelectorTemplate(new AW.Templates.CheckedItem);
+            grid_accounts.setSelectionMode("none");
+            grid_accounts.setSelectionMultiple(true);
+            grid_accounts.setSelectorResizable(true);';
+            //grid_accounts.setSelectorWidth(' . (strlen(count($this->groupArr)) * 10) . ');
+
+        $this->jsAppend .= '
+            grid_accounts.onSelectorClicked = function(value, i){
+                grid_accounts.getSelectorTemplate(i).refresh();
+            }';
+
+        $this->jsAppend .= '
+            /*************************************************************************
+             *
+             * OnClick event for "Search" button
+             *
+             * @param   VOID
+             * @return  VOID
+             *
+             *************************************************************************/
+            function onClickSearch () {
+                setCookie("rowStart", 1);
+                setCookie("a_pageIndex", 1);
+                if (document.forms["form_mainView"].actionStr.value == "") {
+                    document.forms["form_mainView"].target = "mainView";
+                    document.forms["form_mainView"].actionStr.value = "' . $this->classId . '_search";
+                    document.forms["form_mainView"].submit();
+                } else {
+                    document.forms["form_mainView"].submit();
+                }
+            }
+            ';
+
+        $this->jsAppend .= '
+            /*************************************************************************
+             *
+             * Set page index
+             *
+             * @param   integer - page index
+             * @return  VOID
+             *
+             *************************************************************************/
+            function setPageIndex (in_pageIndex) {
+                g_pageIndexOld = g_pageIndex;
+                g_pageIndex = in_pageIndex;
+                setCookie("a_pageIndex", in_pageIndex);
+                window.location.replace(window.location.href);
+
+            }
+            ';
+
+        $this->jsAppend .= '
+            function add_group() {
+                    var t_groups = grid_accounts.getSelectedRows();
+                    var select_count = t_groups.length;
+                    if(select_count > 10) {
+                        displaySPMessage("' . language::translate('error_more_than_ten_items') . '");
+                        return;
+                    }
+                    var t_groupList = document.forms["form_mainView"].cliWrap_vRoleAddQualification_s_condition_content_select.value;
+                    for (var i in t_groups) {
+                        var id = t_groups[i];
+                        t_groupList += "," + accountDataValue[id][0];
+                    }
+                    if ((t_groupList != "") && (t_groupList.indexOf(",") == 0)) {
+                        t_groupList = t_groupList.substring(1);
+                    }
+                    document.forms["form_mainView"].cliWrap_vRoleAddQualification_s_condition_content_select.value = t_groupList;
+                    document.forms["form_mainView"].target = "mainView";
+                    formAction_setPage("vRoleAddQualification");	
+            }
+            function cancel_group() {
+                    document.forms["form_mainView"].target = "mainView";
+                    formAction_setPage("vRoleAddQualification");
+            }
+        ';
+
+
+    }
+
+    /********************************************************************
+    *
+    * Add supporting javascript code to be executed at the beginning
+    * of the page "onload" event
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setJsOnLoadStart () {
+        // Example:  $this->jsOnLoadStart .= 'window.alert("Hello");';
+
+    }
+
+    /********************************************************************
+    *
+    * Add supporting javascript code to be executed at the end
+    * of the page "onload" event
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setJsOnLoadEnd () {
+        // Example:  $this->jsOnLoadEnd .= 'window.alert("Hello");';
+        $this->jsOnLoadEnd .= '';
+    }
+
+    /********************************************************************
+    *
+    * Add supporting CSS code to be inserted inside 
+    * the global <STYLE></STYLE> container
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setCSSAppend () {
+        $this->cssAppend .= '#grid_accounts {height: 300px; width: 100%; border: 2px inset; background: white}';
+        $this->cssAppend .= '#grid_accounts .aw-column-0 {text-align: left; width: 200px;}';
+    }
+
+    /********************************************************************
+    *
+    * Add supporting JavaScript code to be executed during the
+    * <FORM> onReset event.
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setJsOnResetAppend () {
+        // Example:  $this->jsOnResetAppend .= 'window.alert("Hello from setJsOnResetAppend...");';
+    }
+
+    /********************************************************************
+    *
+    * Add supporting JavaScript code to be executed during the
+    * <FORM> onSave event.
+    *
+    * $param    void
+    * @return   void
+    *
+    ********************************************************************/
+    function setJsOnSaveAppend () {
+        // Example:  $this->jsOnSaveAppend .= 'window.alert("Hello from setJsOnSaveAppend...");';
+    }
+
+    /********************************************************************
+    * 
+    * Get SAML Group Name Array by content(of cli)
+    * $param    string    $content
+    * $param    string    $search_name
+    * @return   array
+    ********************************************************************/
+    function getSAMLGroupNames ($content, $search_name) {
+        $result = array();
+        foreach ($content as $_line) {
+            if ($_line->cmdid != "aaa saml idp attributes") {
+                continue;
+            }
+            if (trim($search_name) != "" && strpos($_line->groupname, $search_name) === false) {
+                // Group name not in search result
+                continue;
+            }
+            $result[] = $_line->groupname;
+        }
+        return $result;
+    }
+
+}
+?>
