Beispiel #1
0
def Main():
    cgiEnv = lib_oracle.OracleEnv()

    oraPackage = cgiEnv.m_entity_id_dict["Package"]
    oraSchema = cgiEnv.m_entity_id_dict["Schema"]

    grph = cgiEnv.GetGraph()

    node_oraPackage = oracle_package.MakeUri(cgiEnv.m_oraDatabase, oraSchema,
                                             oraPackage)

    node_oraSchema = oracle_schema.MakeUri(cgiEnv.m_oraDatabase, oraSchema)
    grph.add((node_oraSchema, pc.property_oracle_package, node_oraPackage))

    # TODO: This is problematic as these could also be functions.
    # TODO: But when joining with ALL_OBJECTS, most rows are gone. So what to do ?
    sql_query = "select distinct procedure_name from all_procedures where object_type='PACKAGE' " \
       "and owner='" + oraSchema + "' and object_name='" + oraPackage + "'"
    DEBUG("sql_query=%s", sql_query)
    result = lib_oracle.ExecuteQuery(cgiEnv.ConnectStr(), sql_query)

    propProcToPackage = lib_common.MakeProp("Package")
    for row in result:
        procedureName = row[0]
        procedureNode = oracle_procedure.MakeUri(cgiEnv.m_oraDatabase,
                                                 oraSchema, procedureName)
        grph.add((node_oraPackage, propProcToPackage, procedureNode))

    cgiEnv.OutCgiRdf("LAYOUT_SPLINE", [propProcToPackage])
Beispiel #2
0
def Main():
	cgiEnv = lib_oracle.OracleEnv()

	oraSchema = cgiEnv.m_entity_id_dict["Schema"]

	grph = cgiEnv.GetGraph()

	sql_query = "SELECT OBJECT_NAME,STATUS,CREATED FROM ALL_OBJECTS WHERE OBJECT_TYPE = 'PROCEDURE' AND OWNER = '" + oraSchema + "'"
	DEBUG("sql_query=%s", sql_query )

	node_oraschema = oracle_schema.MakeUri( cgiEnv.m_oraDatabase, oraSchema )

	result = lib_oracle.ExecuteQuery( cgiEnv.ConnectStr(), sql_query)

	for row in result:
		procedureName = str(row[0])
		nodeProcedure = oracle_procedure.MakeUri( cgiEnv.m_oraDatabase , oraSchema, procedureName )
		grph.add( ( node_oraschema, pc.property_oracle_procedure, nodeProcedure ) )

		lib_oracle.AddLiteralNotNone(grph,nodeProcedure,"Status",row[1])
		lib_oracle.AddLiteralNotNone(grph,nodeProcedure,"Creation",row[2])

	cgiEnv.OutCgiRdf("LAYOUT_RECT",[pc.property_oracle_procedure])
Beispiel #3
0
def AddDependency(grph, row, nodeRoot, oraDatabase, direction):
    depOwner = str(row[0])
    depName = str(row[1])
    depType = str(row[2])

    if depType == "TABLE":
        nodeObject = oracle_table.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "VIEW":
        nodeObject = oracle_view.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "PACKAGE":
        nodeObject = oracle_package.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "PACKAGE BODY":
        nodeObject = oracle_package_body.MakeUri(oraDatabase, depOwner,
                                                 depName)
    elif depType == "SYNONYM":
        nodeObject = oracle_synonym.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "TYPE":
        nodeObject = oracle_type.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "SEQUENCE":
        nodeObject = oracle_sequence.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "LIBRARY":
        nodeObject = oracle_library.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "PROCEDURE":
        nodeObject = oracle_procedure.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "FUNCTION":
        nodeObject = oracle_function.MakeUri(oraDatabase, depOwner, depName)
    elif depType == "TRIGGER":
        nodeObject = oracle_trigger.MakeUri(oraDatabase, depOwner, depName)
    else:
        lib_common.ErrorMessageHtml(
            "Unknown dependency depType=%s depName=%s" % (depType, depName))
        return

    if direction == True:
        grph.add((nodeRoot, pc.property_oracle_depends, nodeObject))
    else:
        grph.add((nodeObject, pc.property_oracle_depends, nodeRoot))