<%@LANGUAGE="VBSCRIPT"%> <% '===================================================== '| | '| BomVersionTree | '| | '===================================================== %> <% Option explicit Response.Expires = 0 %> <% '------------ ACCESS CONTROL ------------------ %> <% '------------ VARIABLE DEFINITION ------------- Dim rsQry Dim parBom_id_list Dim parBom_name_id Dim parRoot_version Dim currLevel Dim lastLevel Dim aOptionList Dim query Dim objPopupMenuTreeOptions Dim objFormCollector '------------ CONSTANTS DECLARATION ----------- Const LIMG_TREE_I_HALF = "" Const LIMG_TREE_I_FULL = "" Const LIMG_TREE_T = "" '------------ VARIABLE INIT ------------------- parBom_id_list = Request("bom_id_list") parBranch_id = Request("branch_id") parRoot_version = Request("root_version") parBom_name_id = Request("bom_name_id") Set objPopupMenuTreeOptions = New PopupMenuControl Set objFormCollector = CreateObject("Scripting.Dictionary") objPopupMenuTreeOptions.PopupMenuStyle ReadFile( Server.MapPath("scripts/popup_menu_styles.html") ), "StyleWinXP" '------------ CONDITIONS ---------------------- If (parBom_id_list <> "") AND (parRoot_version = "") AND (parBom_name_id = "") Then ' Get root version and bom_name_id from bom_id_list Call GetParameters ( parBom_id_list, parRoot_version, parBom_name_id ) End If '---------------------------------------------- %> <% '-------------------------------------------------------------------------------------------------------------------------- Sub GetFormDetails ( nBomNameId, ByRef outobjDetails ) Dim rsQry, query OraDatabase.Parameters.Add "BOM_NAME_ID", nBomNameId, ORAPARM_INPUT, ORATYPE_NUMBER query = _ " SELECT bn.BOM_NAME FROM BOM_NAMES bn WHERE bn.BOM_NAME_ID = :BOM_NAME_ID" Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT ) If rsQry.RecordCount > 0 Then outobjDetails.Item ("bom_name") = rsQry("bom_name").Value End If OraDatabase.Parameters.Remove "BOM_NAME_ID" rsQry.Close Set rsQry = Nothing End Sub '---------------------------------------------------------------------------------------------------------------------------------------------- Sub GetParameters ( nBomIdList, ByRef outRootVersion, ByRef outBomNameId ) Dim oBomCollector Set oBomCollector = CreateObject("Scripting.Dictionary") Call GetBomDetails ( nBomIdList, oBomCollector ) outRootVersion = GetRootVersion ( oBomCollector.Item("bom_version") ) outBomNameId = oBomCollector.Item("bom_name_id") Set oBomCollector = Nothing End Sub '---------------------------------------------------------------------------------------------------------------------------------------------- Function GetLevel ( sBomVersion ) Dim tempArr If InStr( sBomVersion, "." ) > 0 Then '-- Dot separator found -- '-- Split version -- tempArr = Split( sBomVersion, "." ) GetLevel = UBound( tempArr ) + 1 Else GetLevel = 1 End If End Function '---------------------------------------------------------------------------------------------------------------------------------------------- Sub RenderRowConnectors ( nLastLevel, nCurrLevel ) Dim i, LastLine '-- Initial Draw -- If nLastLevel = 0 Then nLastLevel = nCurrLevel Exit Sub End If '-- Calculate number of half lines rendered If nLastLevel < nCurrLevel Then LastLine = nLastLevel Else LastLine = nCurrLevel End If '-- Render half lines For i = 1 To LastLine Response.write LIMG_TREE_I_HALF Next End Sub '---------------------------------------------------------------------------------------------------------------------------------------------- Sub RenderIndent ( nLastLevel, nCurrLevel ) Dim i If nCurrLevel <= 1 Then Exit Sub '-- Render half lines If nCurrLevel > 2 Then For i = 1 To nCurrLevel - 2 Response.write LIMG_TREE_I_FULL Next End If '-- Render branch or line If nLastLevel < nCurrLevel Then Response.write LIMG_TREE_T Else Response.write LIMG_TREE_I_FULL End If End Sub '---------------------------------------------------------------------------------------------------------------------------------------------- %> <% '------------ RUN BEFORE PAGE RENDER ---------- Call objPMod.PersistInQryStringWithValue ( aPersistList(enumPAR_ROOT_VERSION), parRoot_version ) Call objPMod.PersistInQryStringWithValue ( aPersistList(enumPAR_BOM_NAME_ID), parBom_name_id ) If (Request("action") <> "") Then '-- Select Action Call ActionRedirection ( Request("action") ) End If Call GetFormDetails ( parBom_name_id, objFormCollector ) '---------------------------------------------- %> Deployment Manager
 
  Version Tree
" class="body_link">Release Explorer
  <% '-- FROM START --------------------------------------------------------------------------------------------------------- objFormComponent.FormName = "FormState" objFormComponent.Action = SCRIPT_NAME Call objFormComponent.FormStart() %> <% Call objFormComponent.FormEnd() '-- FROM END ---------------------------------------------------------------------------------------------------------------- %>
<%=objFormCollector.Item("bom_name")%>

<% '/* Option Menu */ aOptionList = Array( "pmiNewBom", _ "pmiDestroyBom", _ enumSEPARATOR_LABEL, _ "pmiLockBom", _ "pmiUnlockBom" ) query = GetQuery ("PopupMenuItemsList.sql") query = Replace ( query, "%ITEM_LIST%", Join( aOptionList, "','") ) Set rsQry = OraDatabase.DbCreateDynaset( query , ORADYN_DEFAULT ) '--- Render Option Menus If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then With objPopupMenuTreeOptions .LoadRows rsQry.GetRows() Response.write "" .RenderInOrder "divTreeOption", aOptionList, objAccessControl, "pmoCreator" End With End If rsQry.Close %> <% OraDatabase.Parameters.Add "BOM_NAME_ID", parBom_name_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "BRANCH_ID", parBranch_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "BOM_VERSION", parRoot_version, ORAPARM_INPUT, ORATYPE_VARCHAR2 OraDatabase.Parameters.Add "LIKE_BOM_VERSION", parRoot_version &".%", ORAPARM_INPUT, ORATYPE_VARCHAR2 Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomVersionTree.sql") , ORADYN_DEFAULT ) lastLevel = 0 While ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) currLevel = GetLevel ( rsQry("bom_version") ) %> <% lastLevel = currLevel rsQry.MoveNext WEnd rsQry.Close Set rsQry = Nothing OraDatabase.Parameters.Remove "BOM_NAME_ID" OraDatabase.Parameters.Remove "LIKE_BOM_VERSION" OraDatabase.Parameters.Remove "BOM_VERSION" OraDatabase.Parameters.Remove "BRANCH_ID" %>
<%Call RenderRowConnectors( lastLevel, currLevel )%>
<%Call RenderIndent( lastLevel, currLevel )%>">" class="menu_link" title="Open BOM..."><%=BomIcon( rsQry("is_readonly"), rsQry("is_rejected") )%><%=rsQry("bom_version") &"."& rsQry("bom_lifecycle")%>
<%=objPMod.ComposeHiddenTags()%>
<% '------------ RUN AFTER PAGE RENDER ----------- Set objPMod = Nothing Set objCrumbs = Nothing '---------------------------------------------- %>