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
Relattribute
(Web Publishing)


Vytvořeno: 03-27-2000 11:25:39
Poslední změna: 01-10-2003 13:14:30

Outputs detailed information about the given Attribute of a Relation.

Modul

Module: Web Publishing

Zdrojový kód:

PROCEDURE Relattribute(Relation$, Name$)
BEGIN
  foundsomething! = FALSE;
  FOREACH Relattribute WHERE Relattribute.Relation = Relation$
                       AND Relattribute.Name = Name$ DO
    foundsomething! = TRUE;
    CALL Header("Atribut - " + Name);
    FOR Relation WHERE Relation.Name = Relattribute.Relation DO
      CALL Title2("Atribut", Relattribute.Name, Conv$(Relation.Boxname));
    END
  END

  //display a dummy title if the element does not exist
  IF NOT foundsomething! THEN
    CALL Header("Atribut - " + name$);
    CALL Title ("Atribut", name$);
    CALL H2_Spaceless("Projekt neobsahuje atribut daného jména.");
    PRINT {HTML} "<BR>",NL;
  END

  IF foundsomething! THEN
    FOREACH Relattribute WHERE Relattribute.Relation = Relation$
                         AND Relattribute.Name = Name$ DO
    
      //link for Comment
      PRINT {HTML} Anchor$("","Comm", ""), NL;
      //general object data without state and responsable user and with comment
      CALL GenObjectData(Object, FALSE, TRUE);
      PRINT {HTML} "<HR SIZE=""1"" COLOR=""#3366CC"">", NL;

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

      //two column table with all the data - one line per property
      CALL H2_TopSpaceless("Vlastnosti");
      PRINT {HTML} "<TABLE NOWRAP VALIGN=BASELINE>",NL;
      
      //Relation
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Relace:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      FOR Relation WHERE Relation.Name = Relattribute.Relation DO
          PRINT {HTML} "<I>" + Anchor$(Conv$(Boxname), "", Str$(Object) + ".htm") + "</I></FONT></TD>", NL;
      END
      PRINT {HTML} " </TR>",NL;

      //Data element
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Datový element:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      FOR Data WHERE Data.Name = Relattribute.Data DO
        PRINT {HTML} "<I>" + Anchor$(Boxname, "", Str$(Object) + ".htm") + "</I></FONT></TD>", NL;
      END
      PRINT {HTML} " </TR>",NL;

      //notnull
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Povolena hodnota null:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      IF Notnull THEN
        PRINT {HTML} "<I>ne</I></FONT></TD>",NL;
      ELSE
        PRINT {HTML} "<I>ano</I></FONT></TD>",NL;
      END
      PRINT {HTML} " </TR>",NL;
      
      //With default
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>S defaultní hodnotou:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      IF Withdefault THEN
        PRINT {HTML} "<I>ano</I></FONT></TD>",NL;
      ELSE
        PRINT {HTML} "<I>ne</I></FONT></TD>",NL;
      END
      PRINT {HTML} " </TR>",NL;

      //implementation
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Implementace:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      IF Private THEN
        PRINT {HTML} "<I>ano</I></FONT></TD>",NL;
      ELSE
        PRINT {HTML} "<I>ne</I></FONT></TD>",NL;
      END
      PRINT {HTML} " </TR>",NL;
      
      //technical name
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Technický název:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<I>" + Id + "</I></FONT></TD>", NL;
      PRINT {HTML} " </TR>",NL;
      
      //end of table
      PRINT {HTML} "</TABLE>",NL;
      PRINT {HTML} "<HR SIZE=""1"" COLOR=""#3366CC"">", NL;

      //two column table with userdefined properties of the element - one line per property
      CALL GenUserdefinedProperties(Object);
      
      // List of references to attributes
      CALL H2_TopSpaceless("Odpovídající atribut entit");
      PRINT {HTML} " <FONT SIZE=2 FACE=""Verdana, Arial"">";
      IF Private THEN
        PRINT {HTML} "Implementační atribut.",NL;
      ELSE
        foundattrcon! = FALSE;
        first! = TRUE;
        FOREACH Attributeconnection WHERE Attributeconnection.Relation = Relattribute.Relation
                                    AND Attributeconnection.Relattribute = Relattribute.Name
                                    ORDER BY Entity, Attribute DO
            foundattrcon! = TRUE;
            IF first! THEN
                PRINT {HTML} "Atribute odpovídá následujícím atributům entit: <BR><BR> ",NL;
                PRINT {HTML} "<TABLE>", NL;
            ELSE
                PRINT {HTML} "<TR>";
            END

            //Attribute
            FOR Attribute WHERE Attribute.Entity = Attributeconnection.Entity
                          AND Attribute.Name = Attributeconnection.Attribute DO
                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$(Attribute.Name, "", Str$(Object) + ".htm");
                PRINT {HTML} "</FONT></TD>";
            END

            //Entity type
            FOR Entity WHERE Entity.Name = Attributeconnection.Entity DO
                PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
                PRINT {HTML} " (" + Anchor$(Conv$(Entity.Boxname), "", Str$(Object) + ".htm") + ")";
                PRINT {HTML} "</FONT></TD></TR>",NL;
            END
            first! = FALSE;
        END
        PRINT {HTML} "</TABLE>",NL;

        IF NOT foundattrcon! THEN
            PRINT {HTML} "Atribut nemá odpovídající atribut entity.", "<BR>", NL;
        END
        PRINT {HTML} "<BR>",NL;
      END
      
      //usage in index and constraint
      CALL H2_TopSpaceless("Využit v indexech/omezeních");
      foundUsage! = FALSE;
      FOREACH Indexattribute WHERE Relation = Relattribute.Relation
                             AND Attribute = Relattribute.Name
                             ORDER BY Index DO
        foundUsage! = TRUE;
        BREAK;
      END
      IF foundUsage! THEN
        PRINT {HTML} NL, "<TABLE CELLPADDING=2 NOWRAP VALIGN=BASELINE>",NL;
        FOREACH Indexattribute WHERE Relation = Relattribute.Relation
                               AND Attribute = Relattribute.Name
                               ORDER BY Index DO
          PRINT {HTML} " <TR>", NL;
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=""top"">";
          PRINT {HTML} "</FONT></TD>", NL;
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          FOR Index WHERE Relation = Indexattribute.Relation
                    AND Name = Indexattribute.Index DO
            PRINT {HTML} Anchor$(Name, "", Str$(Object) + ".htm");
            PRINT {HTML} "</FONT></TD>", NL;
            PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
            IF Type = 0 THEN
              PRINT {HTML} " index";
            ELSE
              PRINT {HTML} " omezení";
            END
          END
          PRINT {HTML} "</FONT></TD></TR>", NL;
        END
        PRINT {HTML} "</TABLE>", NL;
      ELSE
        PRINT {HTML} "Atribut není použit v indexu/omezení.", "<BR>", NL;
      END
      PRINT {HTML} "<BR>",NL;

      //usage in tsd
      CALL H2_TopSpaceless("Využit v typových strukturách");
      foundUsage! = FALSE;
      lastTsd$ = "";
      FOREACH Tfield WHERE Relation = Relattribute.Relation
                     AND Relattribute = Relattribute.Name
                    ORDER BY Typestructure DO
        IF Tfield.Typestructure <> lastTsd$ THEN
          lastTsd$ = Tfield.Typestructure;
          FOR Typestructure WHERE Name = Tfield.Typestructure 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} "Atribut není použit v žádné typové struktuře.", NL;
      END

      PRINT {HTML} "</FONT>",NL;
    END
  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\143938740.htm (C) microTOOL GmbH 2002