Informační tok Funkční structura Datová struktura ER model Modulová struktura Typová struktura Relační model Dokumentace


[Celkový datový model] [Funkce] [Externí rohraní] [Stavové diagramy] [Datové elementy] [Entity] [Relace]
[Databáze] [Události] [Materiály] [Generovací funkce] [Vyhodnocovací funkce] [Konfigurace] [Uživatelé] [Projekt] [Home]



Vyhodnocovací funkce
Entity
(Web Publishing)


Vytvořeno: 03-05-1997 11:26:53
Poslední změna: 01-07-2003 13:31:03

Outputs detailed information about the given entity type.

Modul

Module: Web Publishing

Zdrojový kód:

PROCEDURE Entity(name$)
BEGIN
  //note.. pages with attributes are being generated implicitly..

  foundsomething! = FALSE;
  foundattrib! = FALSE;
  foundattrcon! = FALSE;
  first! = TRUE;
  FOR Entity WHERE Name = Name$ DO
    foundsomething! = TRUE;
    CALL Header("Entita - " + Conv$(Boxname));
    CALL Title ("Entita", Conv$(Boxname));
  END

  //display a dummy title if the data elem does not exist
  IF NOT foundsomething! THEN
    CALL Header("Entita - " + name$);
    CALL Title ("Entita", name$);
  END

  IF foundsomething! THEN
    FOR Entity WHERE Name = Name$ DO
    
      //general object data
      CALL GenObjectData(Object, TRUE, TRUE);
      PRINT {HTML} "<HR SIZE=""1"" COLOR=""#3366CC"">", NL;

      //description of the object, if avialable
      CALL GetSystemProperty("WebPubDescriptionPage", sepPage$);
      IF hasText THEN
        IF sepPage$ = "TRUE" THEN
          PRINT {HTML} Anchor$("<B>Popis</B>", "", "desc" + Str$(Entity.Object) + ".htm");
          PRINT {HTML} "<BR>",NL;
          PRINT {HTML} "<HR SIZE=""1"" COLOR=""#3366CC"">", NL;
        ELSE
          IF Semantic <> "" THEN
            dummy$ = Semantic;
            PRINT dummy$;
            PRINT {HTML} "<BR>",NL;
            PRINT {HTML} "<HR SIZE=""1"" COLOR=""#3366CC"">", NL;
          END
        END
      END

      //two column table with userdefined properties of the element - one line per property
      CALL GenUserdefinedProperties(Object);

      //attributes
      CALL H2_TopSpaceless("Atributy");
      foundattrib! = FALSE;
      FOREACH Attribute WHERE Entity = Entity.Name DO
        foundattrib! = TRUE;
        BREAK;
      END
      IF foundattrib! THEN
        PRINT {HTML} "<TABLE>",NL;
        PRINT {HTML} " <TR>",NL;
        PRINT {HTML} " <TH VALIGN=TOP ALIGN=LEFT COLSPAN=2><FONT SIZE=2 FACE=""Verdana, Arial"">Name</FONT></TH>";
        PRINT {HTML} " <TH VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Hodnota null<BR>povolena</FONT></TH>";
        PRINT {HTML} " <TH VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">S<BR>Default hodnotou</FONT></TH>";
        PRINT {HTML} " <TH VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Odpovídající<BR>atributy (relací)</FONT></TH>";
        PRINT {HTML} " <TH VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Datový element</FONT></TH>";
        PRINT {HTML} " <TH VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Popis</FONT></TH>";
        PRINT {HTML} " <TH VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Komentář</FONT></TH>";
        PRINT {HTML} " </TR>", NL;

        FOREACH Attribute AS AT WHERE Entity = Entity.Name ORDER BY Position DO
          //generate the pages for the attributes
          CALL Attribute(Entity, Name) INTO Str$(Object) + ".htm";
          
          PRINT {HTML} " <TR>",NL;
          
          //name
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><IMG SRC = ""bullet.gif""></TD>",NL;
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          PRINT {HTML} Anchor$("<B>" + Name + "</B>", "", Str$(Object) + ".htm");
          PRINT {HTML} "</FONT></TD>", NL;
          
          //not null?
          PRINT {HTML} " <TD ALIGN=CENTER VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          IF NotNull THEN
            PRINT {HTML} "ne";
          ELSE
            PRINT {HTML} "ano";
          END
          PRINT {HTML} "</FONT></TD>",NL;

          //with default?
          PRINT {HTML} " <TD ALIGN=CENTER VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          IF NOT NotNull THEN
            PRINT {HTML} "-";
          ELSE
            IF Withdefault THEN
                PRINT {HTML} "ano";
            ELSE
                PRINT {HTML} "ne";
            END
          END
          PRINT {HTML} "</FONT></TD>",NL;

          //Attributeconnections
          IF Private THEN
            PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
            PRINT {HTML} "Problem domain atribut</FONT></TD>",NL;
          ELSE
            foundattrcon! = FALSE;
            first! = TRUE;
            PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
            FOREACH Attributeconnection WHERE Attributeconnection.Entity = AT.Entity
                                        AND Attributeconnection.Attribute = AT.Name
                                        ORDER BY Relation, Relattribute DO
                foundattrcon! = TRUE;
                //Attribute
                IF NOT first! THEN
                    PRINT {HTML} "<BR>";
                END
                FOR Relattribute WHERE Relattribute.Relation = Attributeconnection.Relation
                                 AND Relattribute.Name = Attributeconnection.Relattribute DO
                    PRINT {HTML} Anchor$(Relattribute.Name, "", Str$(Object) + ".htm");
                END

                //Relation
                FOR Relation WHERE Relation.Name = Attributeconnection.Relation DO
                    PRINT " (";
                    PRINT {HTML} Anchor$(Conv$(Relation.Boxname), "", Str$(Object) + ".htm");
                    PRINT ")";
                END
                first! = FALSE;
            END
            IF NOT foundattrcon! THEN
                PRINT {HTML} " <CENTER>-</CENTER>";
            END
            PRINT {HTML} "</FONT></TD>",NL;
          END
          
          //name of associated data elem
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          IF Data <> "" THEN
            FOR Data WHERE Name = AT.Data DO
              PRINT {HTML} Anchor$( Boxname, "", Str$(Object) + ".htm");
            END
          ELSE
            PRINT {HTML} "<CENTER>-</CENTER>";
          END
          PRINT {HTML} "</FONT></TD>", NL;
          
          // Description
          PRINT {HTML} " <TD ALIGN=CENTER VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          IF AT.Text <> "" THEN
               IF sepPage$ = "TRUE" THEN
              PRINT {HTML} Anchor$("Popis", "", "desc" + Str$(AT.Object) + ".htm");
            ELSE
              PRINT {HTML} Anchor$("Popis", "", Str$(AT.Object) + ".htm" + "#Descr");
            END
          ELSE
            PRINT {HTML} "-";
          END
          PRINT {HTML} "</FONT></TD>",NL;

          // Comment
          PRINT {HTML} " <TD ALIGN=CENTER VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          FOR Object WHERE Object.Id = AT.Object DO
              IF Comment <> "" THEN
                PRINT {HTML} Anchor$( "Komentář", "", Str$(Id) + ".htm" + "#Comm");
              ELSE
                PRINT {HTML} "-";
              END
          END
          PRINT {HTML} "</FONT></TD></TR>",NL;

        END
        PRINT {HTML} "</TABLE>",NL;
      ELSE
        PRINT {HTML} "Tato entita nemá žádné atributy.";
        PRINT {HTML} "<BR>",NL;
      END
      PRINT {HTML} "<BR>",NL;

        // Beziehungen
      
      CALL RshipsHelper(Entity.Name);


      //key definition
      CALL H2_TopSpaceless("Definované klíče");
      foundkey! = FALSE;
      FOREACH Identifier WHERE Entity = Entity.Name ORDER BY Name DO
        foundkey! = TRUE;
        foundkeyElem! = FALSE;
        IF Entity.Primaryidentifier = Identifier.Name THEN
            CALL H3(Identifier.Name + " (P)");
        ELSE
            CALL H3(Identifier.Name);
        END
        // attributes
        FOREACH Identifierattribute WHERE Identifierattribute.Identifier = Identifier.Name
                                      AND Entity = Identifier.Entity DO
        foundkeyElem! = TRUE;
          FOR Attribute WHERE Name = Identifierattribute.Attribute
                          AND Entity = Entity.Name DO
            PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=TOP> ";
            PRINT {HTML} Anchor$("<B>" + Name + "</B>", "", Str$(Object) + ".htm");
            PRINT {HTML} "<BR>", NL;
          END
        END
        //depends on
        FOREACH IdentifierERconnection WHERE Entity = Identifier.Entity
                                         AND Identifier = Identifier.Name
                                    ORDER BY Entity DO
          FOR ERconnection WHERE Entity = IdentifierERconnection.Refentity
                             AND Rship = IdentifierERconnection.Rship
                             AND ERconnectionno = IdentifierERconnection.ERconnectionno DO
            FOR Entity WHERE ERconnection.Entity = Name DO
              foundkeyElem! = TRUE;
              PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=TOP> ";
              PRINT {HTML} Anchor$("<B>" + Conv$(Boxname) + "</B>", "", Str$(Object) + ".htm");
              IF ERconnection.Name <> "" THEN
                  PRINT " (", ERconnection.Name, ", ", ERconnection.Cardinality, ")";
              ELSE
                  PRINT " (", ERconnection.Cardinality, ")";
              END
              PRINT {HTML} "<BR>", NL;
            END
          END
        END
        IF NOT foundkeyElem! THEN
          PRINT {HTML} "Klíč není blíže specifikován.";
        END
        PRINT {HTML} "<BR>",NL;
      END
      IF NOT foundkey! THEN
        PRINT {HTML} "Entita nemá definován žádný klíč.", "<BR>", NL;
      END
      PRINT {HTML} "<BR>",NL;

      //usage in erarea
      CALL H2_TopSpaceless("ER modely obsahující " + Conv$(Boxname));
      foundUsage! = FALSE;
      FOREACH Enode WHERE Entity = Entity.Name DO
        FOR Erarea WHERE Name = Enode.Area DO
          foundUsage! = TRUE;
          PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=""top"">";
          PRINT {HTML} " ", Anchor$(Conv$(Boxname), "", Str$(Object) + ".htm");
          PRINT {HTML} "<BR>",NL;
        END
      END
      IF NOT foundUsage! THEN
        PRINT {HTML} "Entita není použita v žádnén ER modelu.";
        PRINT {HTML} "<BR>",NL;
      END
      PRINT {HTML} "<BR>",NL;

      //usage in ifd
      CALL H2_TopSpaceless("Reference do diagramů informačních toků");
      foundUsage! = FALSE;
      lastIfd$ = "";
      FOREACH Entityref WHERE Entity = Entity.Name DO
        IF Entityref.Ifd <> lastIfd$ THEN
          lastIfd$ = Entityref.Ifd;
          FOR Informationflow WHERE Name = Entityref.Ifd DO
            foundUsage! = TRUE;
            PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=""top"">";
            PRINT {HTML} " ", Anchor$(Conv$(Boxname), "", Str$(Object) + ".htm");
            PRINT {HTML} "<BR>",NL;
          END
        END
      END
      IF NOT foundUsage! THEN
        PRINT {HTML} "Entita není referencována do žádného informačního toku.";
        PRINT {HTML} "<BR>",NL;
      END
      PRINT {HTML} "<BR>",NL;

      //usage in dsd
      CALL H2_TopSpaceless("Reference do datových struktur");
      foundUsage! = FALSE;
      lastDsd$ = "";
      FOREACH Entitypart WHERE Entity = Entity.Name DO
        IF Entitypart.Datastructure <> lastDsd$ THEN
          lastDsd$ = Entitypart.Datastructure;
          FOR Datastructure WHERE Name = Entitypart.Datastructure DO
            foundUsage! = TRUE;
            PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=""top"">";
            PRINT {HTML} " ", Anchor$(Conv$(Boxname), "", Str$(Object) + ".htm");
            PRINT {HTML} "<BR>",NL;
          END
        END
      END
      IF NOT foundUsage! THEN
        PRINT {HTML} "Entita není použita v žádné datové struktuře.";
        PRINT {HTML} "<BR>",NL;
      END
      PRINT {HTML} "<BR>",NL;

      //associated relation
      CALL H2_TopSpaceless("Odpovídající relace");
      IF Entity.Private THEN
        PRINT {HTML} " <TD ALIGN=CENTER VALIGN=TOP COLSPAN=2><FONT SIZE=2 FACE=""Verdana, Arial"">";
        PRINT {HTML} "Entita je problem domain. </FONT></TD>",NL;
      ELSE
        foundrel! = FALSE;
        FOR Relation WHERE Entity = Entity.Name DO
          foundrel! = TRUE;
          PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=TOP> ";
          PRINT {HTML} Anchor$(Conv$(Boxname), "", Str$(Object) + ".htm"), "<BR>",NL;
        END
        IF NOT foundrel! THEN
          PRINT {HTML} "Entita nemá odpovídající relaci.", "<BR>", NL;
        END
      END
      PRINT {HTML} "<BR>", NL;
      
    END
  ELSE
    CALL H2_Spaceless("V projektu není entita daného jména.");
    PRINT {HTML} "<BR>",NL;
  END
  CALL Footer("");
END


Generováno: 16.10.2003 7:41 Systém: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\Projekt03.csf Generováno systémem case/4/0
Vygeneroval: Administrator Soubor: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\html\8452.htm (C) microTOOL GmbH 2002