Subversion Repositories DevTools

Rev

Rev 1281 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'=====================================================
'                                       UPDATE ANT
'                                   dependencies
'=====================================================
%>
<!--#include file="_tabs.asp"-->
<%
'------------ Variable Definition -------------
Dim parPv_id
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
parPv_id = QStrPar("pv_id")
'----------------------------------------------
%>
<%
Function Current_Dependencies ( SSpv_id )
        Dim rsTemp, Query_String, tempStr
        
        Query_String = _
        " SELECT pkg.pkg_name, pv.pkg_version, UPPER(pkg.pkg_name) AS name_order"&_
    " FROM package_dependencies dep, PACKAGES pkg, package_versions pv"&_
        " WHERE pkg.pkg_id = pv.pkg_id"&_
    "   AND pv.pv_id = dep.dpv_id"&_
    "   AND dep.pv_id = "& SSpv_id &_
        "   AND dep.dpv_id <> 0"&_
        " ORDER BY name_order ASC"
        
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
        
        While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
                tempStr = tempStr & To_JANT( rsTemp.Fields("pkg_name"), rsTemp.Fields("pkg_version") ) & VBNewLine
                rsTemp.MoveNext
        WEnd
        Current_Dependencies = tempStr
        rsTemp.Close
        Set rsTemp = nothing
End Function
%>
<%
Call Get_Pkg_Info ( parPv_id, NULL )
%>
<script language="JavaScript" type="text/javascript">
// Verify if submition is in ANT format
<!--
function IsInANTformat() {
        var val, tempSTR, tempARR, linesARR, rExp, i, maxlimit, rs;
    rs = '';
        val = updatedeps.FRdepsRaw.value;
        document.ANTformat_returnValue = true;
        // remove spaces, tabs, return chars, etc.
        rExp = /\s+/gi;
        val = val.replace(rExp, "");
        rExp = /'/gi;
        val = val.replace(rExp, "\"");
        
        if (val) {
                // Dependencies submited, hence check format
                linesARR = val.split("/");
                maxlimit = linesARR.length - 1; //last element is empty
                for(i=0; i<maxlimit; i++) {
                        tempARR = linesARR[i].split("\"");
                        if (tempARR.length!=5) {
                                alert('Following line does not look like ANT format. \n\n'+ linesARR[i] +'/>'+
                                '\n\nMake sure package name and version are within quotes(\' or \") and \neach line has closing tag(/>).');
                                document.ANTformat_returnValue = false;
                        } else {
                rs += 'JantStyle("' + tempARR[1] + '","' + tempARR[3] + '");\n';
            }
                }
        }
    // Save Massaged data items
    updatedeps.FRdeps.value=rs;
    updatedeps.FRdepsRaw.value = '';
        
        if (document.ANTformat_returnValue) {
                ProgressBar.style.visibility='visible';
        }
}
//-->
</script>
<table width="650" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="1%">&nbsp;</td>
          <td align="right"><img src="images/h_trsp_dot.gif" width="30" height="30"></td>
          <td width="1%">&nbsp;</td>
        </tr>
        <tr> 
          <td width="1%">&nbsp;</td>
          <td> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td nowrap class="form_ttl">IMPORT dependencies</td>
                <td align="right" valign="bottom">
                  <%Call Generate_Tab_Menu ( TABarray2, "JANT style", "blue" )%>
                </td>
              </tr>
            </table>
          </td>
          <td width="1%">&nbsp;</td>
        </tr>
        <tr> 
          <td align="left" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
          <td background="images/lbox_bg_blue.gif">
                    <!-- Heading -->
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td nowrap class="lbox_ttl_w"><%=pkgInfoHash.Item ("pkg_name")%>&nbsp;<%=pkgInfoHash.Item ("pkg_version")%></td>
                                <td width="1%"><img src="images/h_trsp_dot.gif" width="1" height="46"></td>
                <td align="right">
                                <!-- ACTION BUTTONS ------------------------------------------->
                                <!------------------------------------------------------------->
                </td>
              </tr>
            </table>
            <!-- END Heading -->
          </td>
          <td align="right" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
        </tr>
        <tr> 
          <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
          <td bgcolor="#FFFFFF" valign="top"> 
            <!-- Body -->
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
                        <form name="updatedeps" method="post" action="_update_dependencies.asp" onSubmit="IsInANTformat();return document.ANTformat_returnValue;">
              <tr> 
                <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
                <td width="1%" nowrap class="form_group" valign="bottom">DEPENDENCIES<a href="#" onMouseOver="formTips.show('depsant')" onMouseOut="formTips.hide()"><img src="images/i_help.gif" width="12" height="12" hspace="2" align="absmiddle" border="0" ></a></td>
                <td nowrap width="100%">&nbsp; </td>
              </tr>
              <tr> 
                <td width="1%">&nbsp;</td>
                <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">&nbsp;</td>
                <td nowrap width="100%" background="images/bg_form_lightbluedark.gif"> 
                  <textarea name="FRdepsRaw" rows="20" cols="80" wrap="OFF" class="form_item"><%=Current_Dependencies( parPv_id )%></textarea>
                  <input type="hidden" name="pv_id" value="<%=parPv_id%>">
                                  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
                  <input type="hidden" name="action" value="true">
                  <input type="hidden" name="FRdeps" value="">
                  <br>
                                  <span class="form_txt">
                  <b>EXAMPLE:</b><br>
                                  &lt;sandbox name="javainfra" version="5.0.0.mas"/&gt;<br>
                                  &lt;sandbox name="jakarta-struts" version="1.0.0.cots"/&gt;
                                  </span>
                                  </td>
              </tr>
              <tr> 
                <td width="1%">&nbsp;</td>
                <td width="1%" nowrap class="body_scol"><SPAN id="ProgressBar" name="ProgressBar" style="visibility:hidden;"><img src="images/i_processing.gif" width="11" height="17" align="absmiddle" hspace="3">Processing...</SPAN></td>
                <td nowrap width="100%"> 
                  <input type="submit" name="btn" value="Import" class="form_btn">
                  <input type="reset" name="btn" value="Cancel" class="form_btn" onclick="history.go(-<%=ppClick%>);">
                                  <br><br>
                </td>
              </tr>
                        </form>
            </table>
            <!-- END Body-->
          </td>
          <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
        </tr>
        <tr> 
          <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
          <td background="images/lbox_bg_blue.gif"></td>
          <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>