Subinformation (SP-Tag): Unterschied zwischen den Versionen

Aus SiteparkWiki
Zur Navigation springen Zur Suche springen
Zeile 21: Zeile 21:
 
==Syntax==
 
==Syntax==
 
<source lang="xml">
 
<source lang="xml">
<sp:subinformation></sp:subinformation>
+
<sp:subinformation name="sub"></sp:subinformation>
 
</source>  
 
</source>  
  
 
==Beschreibung==
 
==Beschreibung==
Dieser Tag dient zur Gruppierung weiterer SP-Tags. Dadurch werden mehrere Information in einer sog. Subinformation zusammengefasst. Durch Angabe eines optionalen Typs können außerdem noch bestimmte Objekte angelegt werden. So werden z.B. CalendarInformation-Objekte in Templates unter Verwendung dieses Tags beschrieben.
+
Dieser Tag dient zur Gruppierung weiterer SP-Tags. Dadurch werden mehrere Information in einer sog. [[SubInformation]] zusammengefasst. Durch Angabe eines optionalen Typs können außerdem noch bestimmte Objekte angelegt werden. So werden z.B. [[CalendarInformation]]-Objekte in Templates unter Verwendung dieses Tags beschrieben.
  
 
==Attribute==
 
==Attribute==
Zeile 49: Zeile 49:
  
 
;<code>type</code>
 
;<code>type</code>
:Optionale Angabe eines Typs. Dieser Tag erzeugt standardmäßig [[SubinformationVO|Subinformation-Objkete], kann aber auch bestimmte andere Datentypen erstellen. So kann über den Typ <code>calendar</code> ein [[CalendarInformationVO|CalendarInformation-Object] angelegt werden.
+
:Optionale Angabe eines Typs. Dieser Tag erzeugt standardmäßig [[Subinformation|Subinformation-Objkete]], kann aber auch bestimmte andere Datentypen erstellen. So kann über den Typ <code>calendar</code> ein [[CalendarInformation|CalendarInformation-Object]] angelegt werden.
  
 
==Beispiele==
 
==Beispiele==
Zeile 57: Zeile 57:
 
Template Quelltext
 
Template Quelltext
 
<source lang="xml">
 
<source lang="xml">
xxx
+
<sp:io type="in">
 +
 
 +
  <sp:subinformation name="sp_dateItem" type="calendar">
 +
 
 +
    <%-- Typ des Termins --%>
 +
    <sp:text name="calendar" type="calendarType" id="_calendarType" hidden="true"/>
 +
    <select name="calendarType" size="1" onchange="document.getElementById('_calendarType').value=this.options[this.options.selectedIndex].value; document.getElementsByName('SYS_INFE_action')[0].value='edit';document.forms[0].submit();">
 +
      <option value="day"<sp:if name="sp_dateItem.calendar.calendarType" eq="day"> selected="selected"</sp:if>>einfacher Termin (z.B. Urlaub)</option>
 +
      <option value="daily"<sp:if name="sp_dateItem.calendar.calendarType" eq="daily"> selected="selected"</sp:if>>täglicher Termin (z.B. Emails lesen)</option>
 +
      <option value="weekly"<sp:if name="sp_dateItem.calendar.calendarType" eq="weekly"> selected="selected"</sp:if>>wöchentlicher Termin (z.B. jeden Montag Besprechung)</option>
 +
      <option value="monthlyByDay"<sp:if name="sp_dateItem.calendar.calendarType" eq="monthlyByDay"> selected="selected"</sp:if>>Tag X eines Monats (z.B. immer am 15. eines Monats)</option>
 +
      <option value="monthlyByOccurrence"<sp:if name="sp_dateItem.calendar.calendarType" eq="monthlyByOccurrence"> selected="selected"</sp:if>>bestimmter Wochentag eines Monats (z.B. jeder 2. Samstag im Monat)</option>
 +
      <option value="yearlyByDay"<sp:if name="sp_dateItem.calendar.calendarType" eq="yearlyByDay"> selected="selected"</sp:if>>Tag X eines Jahres (z.B. 6. Tag des Jahres)</option>
 +
      <option value="yearlyByOccurrence"<sp:if name="sp_dateItem.calendar.calendarType" eq="yearlyByOccurrence"> selected="selected"</sp:if>>bestimmter Wochentag eines Monats (z.B. Pokalturnier am ersten Wochenende im Juni)</option>
 +
      <option value="yearlyByMonth"<sp:if name="sp_dateItem.calendar.calendarType" eq="yearlyByMonth"> selected="selected"</sp:if>>Tag X eines Monats im Jahr (z.B. Geburtstag)</option>
 +
    </select>
 +
 
 +
    <%-- Start und Ende des Termins --%>
 +
    <table>
 +
        <tr>
 +
        <td>von:</td><td><sp:text name="calendar" id="_calendarFrom" type="calendarFrom" size="10" format="dd.MM.yyyy"/></td>
 +
        <td>bis:</td><td><sp:text name="calendar" id="_calendarTo" type="calendarTo" size="10" format="dd.MM.yyyy"/></td>
 +
        </tr>
 +
    </table>
 +
 
 +
    <%-- ganztägige Termine --%>
 +
    <sp:text name="calendar" type="calendarAllDay" id="_calendarAllDay" fixvalue="true" hidden="true"/>
 +
 
 +
    <%-- Konfiguration der Wiederholungen --%>
 +
    <sp:if condition="${sp_dateItem} != '' && ${sp_dateItem.calendar.calendarType} != 'day'">
 +
      Wiederholungen:<br>
 +
      <table>
 +
          <tr>
 +
          <sp:set name="_readonly" value="false"/><sp:if name="sp_dateItem.calendar.calendarRepetitionCount" gt="0"><sp:set name="_readonly" value="true"/></sp:if>
 +
          <td>Wiederholungen bis:</td><td><sp:text name="calendar" id="_calendarRepetitionDate" type="calendarRepetitionDate" size="10" format="dd.MM.yyyy" readonly="${_readonly}" onchange="document.getElementById('_calendarRepetitionCount').value=0"/></td>
 +
          <td>Anzahl der Wiederholungen:</td><td><sp:text name="calendar" id="_calendarRepetitionCount" type="calendarRepetitionCount" size="3" onchange="document.getElementById('_calendarRepetitionDate').value=''"/></td>
 +
          </tr>
 +
      </table>
 +
 
 +
      <br>
 +
      Interval (0-n):<br><sp:text name="calendar" id="_calendarInterval" type="calendarInterval" size="3"/><br>
 +
 
 +
      <%-- dow --%>
 +
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'weekly' || ${sp_dateItem.calendar.calendarType} == 'monthlyByOccurrence' || ${sp_dateItem.calendar.calendarType} == 'yearlyByOccurrence'">
 +
        <br>
 +
        <sp:condition>
 +
          <sp:if condition="${sp_dateItem.calendar.calendarType} != 'weekly'">
 +
            Tag der Woche:<br>
 +
          </sp:if>
 +
          <sp:else>
 +
            Tage der Woche (Mehrfachauswahl):<br>
 +
          </sp:else>
 +
        </sp:condition>
 +
        <sp:text name="calendar" type="calendarDow" id="_calendarDow" hidden="true"/>
 +
        <select name="calendarDow" size="7" <sp:if condition="${sp_dateItem.calendar.calendarType} == 'weekly'">multiple="true" </sp:if>onchange="var ret = ''; for (i = 0; i < this.length; i++) { if (this.options[i].selected == true) { if (ret != '') ret+=','; ret+=this.options[i].value; }} document.getElementById('_calendarDow').value=ret;">
 +
          <option value="mon"<sp:if name="sp_dateItem.calendar.calendarDow" contains="mon"> selected="selected"</sp:if>>Montag</option>
 +
          <option value="tue"<sp:if name="sp_dateItem.calendar.calendarDow" contains="tue"> selected="selected"</sp:if>>Dienstag</option>
 +
          <option value="wed"<sp:if name="sp_dateItem.calendar.calendarDow" contains="wed"> selected="selected"</sp:if>>Mittwoch</option>
 +
          <option value="thu"<sp:if name="sp_dateItem.calendar.calendarDow" contains="thu"> selected="selected"</sp:if>>Donnerstag</option>
 +
          <option value="fri"<sp:if name="sp_dateItem.calendar.calendarDow" contains="fri"> selected="selected"</sp:if>>Freitag</option>
 +
          <option value="sat"<sp:if name="sp_dateItem.calendar.calendarDow" contains="sat"> selected="selected"</sp:if>>Samstag</option>
 +
          <option value="sun"<sp:if name="sp_dateItem.calendar.calendarDow" contains="sun"> selected="selected"</sp:if>>Sonntag</option>
 +
        </select>
 +
      </sp:if>
 +
 
 +
      <%-- dom --%>
 +
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'monthlyByDay' || ${sp_dateItem.calendar.calendarType} == 'yearlyByMonth'">
 +
        <br>
 +
        Tag der Monats (1-31):<br><sp:text name="calendar" id="_calendarDom" type="calendarDom" size="2"/><br>
 +
      </sp:if>
 +
 
 +
      <%-- oom --%>
 +
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'monthlyByOccurrence' || ${sp_dateItem.calendar.calendarType} == 'yearlyByOccurrence'">
 +
        <br>
 +
        Woche des Monats (1-5):<br><sp:text name="calendar" id="_calendarOom" type="calendarOom" size="1"/><br>
 +
      </sp:if>
 +
 
 +
      <%-- doy --%>
 +
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'yearlyByDay'">
 +
        <br>
 +
        Tag des Jahres (1-365):<br><sp:text name="calendar" id="_calendarDoy" type="calendarDoy" size="3"/><br>
 +
      </sp:if>
 +
 
 +
      <%-- moy --%>
 +
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'yearlyByMonth' || ${sp_dateItem.calendar.calendarType} == 'yearlyByOccurrence'">
 +
        <br>
 +
        Monat des Jahres:<br>
 +
        <sp:text name="calendar" type="calendarMoy" id="_calendarMoy" hidden="true"/>
 +
        <select name="calendarMoy" size="1" onchange="document.getElementById('_calendarMoy').value=this.options[this.options.selectedIndex].value;">
 +
          <option value="0"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="0"> selected="selected"</sp:if>>Januar</option>
 +
          <option value="1"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="1"> selected="selected"</sp:if>>Februar</option>
 +
          <option value="2"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="2"> selected="selected"</sp:if>>März</option>
 +
          <option value="3"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="3"> selected="selected"</sp:if>>April</option>
 +
          <option value="4"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="4"> selected="selected"</sp:if>>Mai</option>
 +
          <option value="5"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="5"> selected="selected"</sp:if>>Juni</option>
 +
          <option value="6"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="6"> selected="selected"</sp:if>>Juli</option>
 +
          <option value="7"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="7"> selected="selected"</sp:if>>August</option>
 +
          <option value="8"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="8"> selected="selected"</sp:if>>September</option>
 +
          <option value="9"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="9"> selected="selected"</sp:if>>Oktober</option>
 +
          <option value="10"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="10"> selected="selected"</sp:if>>November</option>
 +
          <option value="11"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="11"> selected="selected"</sp:if>>Dezember</option>
 +
        </select>
 +
      </sp:if>
 +
    </sp:if>
 +
 
 +
  </sp:subinformation>
 +
</sp:io>
 
</source>
 
</source>
  
 
Ausgabe
 
Ausgabe
 
<source lang="text">
 
<source lang="text">
xxx
+
<sp:print name="sp_dateItem.calendar.calendarFrom" dateformat="dd.MM.yyyy"/> - <sp:print name="sp_dateItem.calendar.calendarTo" dateformat="dd.MM.yyyy"/>
 
</source>
 
</source>
  

Version vom 16. Februar 2009, 16:18 Uhr


Name

<sp:subinformation> - Subinformation-Tag

Syntax

<sp:subinformation name="sub"></sp:subinformation>

Beschreibung

Dieser Tag dient zur Gruppierung weiterer SP-Tags. Dadurch werden mehrere Information in einer sog. SubInformation zusammengefasst. Durch Angabe eines optionalen Typs können außerdem noch bestimmte Objekte angelegt werden. So werden z.B. CalendarInformation-Objekte in Templates unter Verwendung dieses Tags beschrieben.

Attribute

Name Type Required Default ab IES Version
name Variable Ja None 1
type Text Nein None 2.0.3
name
Name der Subinformation.
type
Optionale Angabe eines Typs. Dieser Tag erzeugt standardmäßig Subinformation-Objkete, kann aber auch bestimmte andere Datentypen erstellen. So kann über den Typ calendar ein CalendarInformation-Object angelegt werden.

Beispiele

Erstellung eines CalendarInformation

Template Quelltext

<sp:io type="in">

  <sp:subinformation name="sp_dateItem" type="calendar">

    <%-- Typ des Termins --%>
    <sp:text name="calendar" type="calendarType" id="_calendarType" hidden="true"/>
    <select name="calendarType" size="1" onchange="document.getElementById('_calendarType').value=this.options[this.options.selectedIndex].value; document.getElementsByName('SYS_INFE_action')[0].value='edit';document.forms[0].submit();">
      <option value="day"<sp:if name="sp_dateItem.calendar.calendarType" eq="day"> selected="selected"</sp:if>>einfacher Termin (z.B. Urlaub)</option>
      <option value="daily"<sp:if name="sp_dateItem.calendar.calendarType" eq="daily"> selected="selected"</sp:if>>täglicher Termin (z.B. Emails lesen)</option>
      <option value="weekly"<sp:if name="sp_dateItem.calendar.calendarType" eq="weekly"> selected="selected"</sp:if>>wöchentlicher Termin (z.B. jeden Montag Besprechung)</option>
      <option value="monthlyByDay"<sp:if name="sp_dateItem.calendar.calendarType" eq="monthlyByDay"> selected="selected"</sp:if>>Tag X eines Monats (z.B. immer am 15. eines Monats)</option>
      <option value="monthlyByOccurrence"<sp:if name="sp_dateItem.calendar.calendarType" eq="monthlyByOccurrence"> selected="selected"</sp:if>>bestimmter Wochentag eines Monats (z.B. jeder 2. Samstag im Monat)</option>
      <option value="yearlyByDay"<sp:if name="sp_dateItem.calendar.calendarType" eq="yearlyByDay"> selected="selected"</sp:if>>Tag X eines Jahres (z.B. 6. Tag des Jahres)</option>
      <option value="yearlyByOccurrence"<sp:if name="sp_dateItem.calendar.calendarType" eq="yearlyByOccurrence"> selected="selected"</sp:if>>bestimmter Wochentag eines Monats (z.B. Pokalturnier am ersten Wochenende im Juni)</option>
      <option value="yearlyByMonth"<sp:if name="sp_dateItem.calendar.calendarType" eq="yearlyByMonth"> selected="selected"</sp:if>>Tag X eines Monats im Jahr (z.B. Geburtstag)</option>
    </select>

    <%-- Start und Ende des Termins --%>
    <table>
        <tr>
        <td>von:</td><td><sp:text name="calendar" id="_calendarFrom" type="calendarFrom" size="10" format="dd.MM.yyyy"/></td>
        <td>bis:</td><td><sp:text name="calendar" id="_calendarTo" type="calendarTo" size="10" format="dd.MM.yyyy"/></td>
        </tr>
    </table>

    <%-- ganztägige Termine --%>
    <sp:text name="calendar" type="calendarAllDay" id="_calendarAllDay" fixvalue="true" hidden="true"/>

    <%-- Konfiguration der Wiederholungen --%>
    <sp:if condition="${sp_dateItem} != '' && ${sp_dateItem.calendar.calendarType} != 'day'">
      Wiederholungen:<br>
      <table>
          <tr>
          <sp:set name="_readonly" value="false"/><sp:if name="sp_dateItem.calendar.calendarRepetitionCount" gt="0"><sp:set name="_readonly" value="true"/></sp:if>
          <td>Wiederholungen bis:</td><td><sp:text name="calendar" id="_calendarRepetitionDate" type="calendarRepetitionDate" size="10" format="dd.MM.yyyy" readonly="${_readonly}" onchange="document.getElementById('_calendarRepetitionCount').value=0"/></td>
          <td>Anzahl der Wiederholungen:</td><td><sp:text name="calendar" id="_calendarRepetitionCount" type="calendarRepetitionCount" size="3" onchange="document.getElementById('_calendarRepetitionDate').value=''"/></td>
          </tr>
      </table>

      <br>
      Interval (0-n):<br><sp:text name="calendar" id="_calendarInterval" type="calendarInterval" size="3"/><br>

      <%-- dow --%>
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'weekly' || ${sp_dateItem.calendar.calendarType} == 'monthlyByOccurrence' || ${sp_dateItem.calendar.calendarType} == 'yearlyByOccurrence'">
        <br>
        <sp:condition>
          <sp:if condition="${sp_dateItem.calendar.calendarType} != 'weekly'">
            Tag der Woche:<br>
          </sp:if>
          <sp:else>
            Tage der Woche (Mehrfachauswahl):<br>
          </sp:else>
        </sp:condition>
        <sp:text name="calendar" type="calendarDow" id="_calendarDow" hidden="true"/>
        <select name="calendarDow" size="7" <sp:if condition="${sp_dateItem.calendar.calendarType} == 'weekly'">multiple="true" </sp:if>onchange="var ret = ''; for (i = 0; i < this.length; i++) { if (this.options[i].selected == true) { if (ret != '') ret+=','; ret+=this.options[i].value; }} document.getElementById('_calendarDow').value=ret;">
          <option value="mon"<sp:if name="sp_dateItem.calendar.calendarDow" contains="mon"> selected="selected"</sp:if>>Montag</option>
          <option value="tue"<sp:if name="sp_dateItem.calendar.calendarDow" contains="tue"> selected="selected"</sp:if>>Dienstag</option>
          <option value="wed"<sp:if name="sp_dateItem.calendar.calendarDow" contains="wed"> selected="selected"</sp:if>>Mittwoch</option>
          <option value="thu"<sp:if name="sp_dateItem.calendar.calendarDow" contains="thu"> selected="selected"</sp:if>>Donnerstag</option>
          <option value="fri"<sp:if name="sp_dateItem.calendar.calendarDow" contains="fri"> selected="selected"</sp:if>>Freitag</option>
          <option value="sat"<sp:if name="sp_dateItem.calendar.calendarDow" contains="sat"> selected="selected"</sp:if>>Samstag</option>
          <option value="sun"<sp:if name="sp_dateItem.calendar.calendarDow" contains="sun"> selected="selected"</sp:if>>Sonntag</option>
        </select>
      </sp:if>

      <%-- dom --%>
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'monthlyByDay' || ${sp_dateItem.calendar.calendarType} == 'yearlyByMonth'">
        <br>
        Tag der Monats (1-31):<br><sp:text name="calendar" id="_calendarDom" type="calendarDom" size="2"/><br>
      </sp:if>

      <%-- oom --%>
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'monthlyByOccurrence' || ${sp_dateItem.calendar.calendarType} == 'yearlyByOccurrence'">
        <br>
        Woche des Monats (1-5):<br><sp:text name="calendar" id="_calendarOom" type="calendarOom" size="1"/><br>
      </sp:if>

      <%-- doy --%>
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'yearlyByDay'">
        <br>
        Tag des Jahres (1-365):<br><sp:text name="calendar" id="_calendarDoy" type="calendarDoy" size="3"/><br>
      </sp:if>

      <%-- moy --%>
      <sp:if condition="${sp_dateItem.calendar.calendarType} == 'yearlyByMonth' || ${sp_dateItem.calendar.calendarType} == 'yearlyByOccurrence'">
        <br>
        Monat des Jahres:<br>
        <sp:text name="calendar" type="calendarMoy" id="_calendarMoy" hidden="true"/>
        <select name="calendarMoy" size="1" onchange="document.getElementById('_calendarMoy').value=this.options[this.options.selectedIndex].value;">
          <option value="0"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="0"> selected="selected"</sp:if>>Januar</option>
          <option value="1"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="1"> selected="selected"</sp:if>>Februar</option>
          <option value="2"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="2"> selected="selected"</sp:if>>März</option>
          <option value="3"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="3"> selected="selected"</sp:if>>April</option>
          <option value="4"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="4"> selected="selected"</sp:if>>Mai</option>
          <option value="5"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="5"> selected="selected"</sp:if>>Juni</option>
          <option value="6"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="6"> selected="selected"</sp:if>>Juli</option>
          <option value="7"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="7"> selected="selected"</sp:if>>August</option>
          <option value="8"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="8"> selected="selected"</sp:if>>September</option>
          <option value="9"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="9"> selected="selected"</sp:if>>Oktober</option>
          <option value="10"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="10"> selected="selected"</sp:if>>November</option>
          <option value="11"<sp:if name="sp_dateItem.calendar.calendarMoy" eq="11"> selected="selected"</sp:if>>Dezember</option>
        </select>
      </sp:if>
    </sp:if>

  </sp:subinformation>
</sp:io>

Ausgabe

<sp:print name="sp_dateItem.calendar.calendarFrom" dateformat="dd.MM.yyyy"/> - <sp:print name="sp_dateItem.calendar.calendarTo" dateformat="dd.MM.yyyy"/>

Gruppierung von Textfeldern

Template Quelltext

<sp:subinformation name="sp_textblock">
  <sp:text name="sp_text_a"/><br>
  <sp:text name="sp_text_b"/><br>
</sp:subinformation>

Ausgabe

<sp:print name="sp:textblock.sp_text_a"/> - <sp:print name="sp:textblock.sp_text_b"/>