Lotus Notes / Domino Sonstiges > Java und .NET mit Notes/Domino

Dynamisches Java Applet

<< < (7/9) > >>

animate:
ich weiß echt nicht genau, was du meinst und kann deshalb nicht helfen.

nur ein kleiner Klugscheißer-Tipp noch: es ist keine gute Idee, Server- und DB-Namen hart zu codieren...

CLI_Andreas_Schmidt:
Also ich bin schon wieder etwas weiter: Ich bin jetzt anders vorgegangen: Vielleicht weißt Du jetzt was ich vor habe.

Guckst Du Code:


Was ich noch nicht hinbekommen habe ist jetzt die 3 Ebene. Also die Kommentare. Vielleicht könntest Du die Schleife für mich erweitern. Mir platz gleich der Kopf



---------------------------

Sub Initialize
   Dim s As New NotesSession
   Dim db As NotesDatabase
   Dim v As Notesview
   Dim doc As NotesDocument
   
   Dim stringvarend As String
   Dim navdoc As NotesDocument
   Dim response As NotesDocument
   Dim response2 As NotesDocument
   Dim area As String
   Dim konfview As NotesView
   Dim konfdoc As NotesDocument
   Dim col As NotesDocumentCollection
   Dim i As Integer
   i = 0
   
   
   
   Set db = s.CurrentDatabase
   Set v = db.GetView("content")
   Set doc = v.GetFirstDocument
   
   Set konfview = db.GetView("konfnav")
   Set konfdoc = konfview.GetFirstDocument
   
   If Not (konfdoc Is Nothing) Then
      Call konfdoc.Remove(True)
   End If
   
   While Not (doc Is Nothing)
      
      If doc.form(0)="area" Then
         i = i + 1
' Schreibt den ersten Link mit dem Subject aus dem Hauptdokument
         stringvar = stringvar + {<h1><a href="http://spsrv1/igusIntranet80_b.nsf/content/}   & doc.uniqueid(0) & {?Opendocument" target="content" onMouseOver="return toggleMenu('menu} & i & {')">} & doc.a_area(0)  & {</a></h1>}
         
' Das erste Antwortdokument zum Hauptdokument laden   
         Set response = v.getchild(doc)
         
         If Not (response Is Nothing) Then
            stringvar = stringvar + {<SPAN id='menu} & i & {'>}
         End If
         
         While Not ( response Is Nothing )
            
            stringvar = stringvar + {<h1><a href="http://spsrv1/igusIntranet80_b.nsf/content/}   & response.uniqueid(0) & {?Opendocument"  target="content" onMouseOver="return toggleMenu('menu2')">} & response.CSubject(0) & {</a></h1>}                                 
            
            Set response = v.GetNextSibling( response )
            
            If (response Is Nothing) Then
               stringvar = stringvar + {</SPAN>}
            End If
            
         Wend
         Goto weiter
         Set response2 = v.getchild(response)
         While Not ( response2 Is Nothing )
            stringvar = stringvar + {<h1><a href="http://spsrv1/igusIntranet80_b.nsf/content/}   & response2.uniqueid(0) & {?Opendocument"  target="content">} & response2.CCSubject(0) & {</a></h1>}                                 
            Set response2 = v.GetNextSibling( response2 )
            If (response2 Is Nothing) Then
               stringvar = stringvar + {</SPAN>}
            End If               
         Wend
         
      End If
      
weiter:
      
      stringvarend = stringvarend + stringvar
      stringvar=""
      
      Set doc = v.GetNextDocument(doc)
      
   Wend   
   
   Set navdoc = db.CreateDocument
   navdoc.form = "konfnav"
   navdoc.label = stringvarend
   Call navdoc.save(True,True)
   
   
   
End Sub

Marinero Atlántico:
Ich glaub du musst das

--- Code: ---Set response2 = v.getchild(response)
         While Not ( response2 Is Nothing )
            stringvar = stringvar + {<h1><a href="http://spsrv1/igusIntranet80_b.nsf/content/}  & response2.uniqueid(0) & {?Opendocument"  target="content">} & response2.CCSubject(0) & {</a></h1>}                                
            Set response2 = v.GetNextSibling( response2 )
            If (response2 Is Nothing) Then
               stringvar = stringvar + {</SPAN>}
            End If              
         Wend

--- Ende Code ---
vor das wend darüber packen. Und davor noch ein öffnendes Span legen.
Es ist wirklich nicht einfach ohne Daten.
... und ich mache ja gerade deshalb "ach-so-schwierige" Objekt Orientierung, um solche "einfachen" Schleifenkonstruktionen zu vermeiden.
Das ist wohl mehr was für "richtige Programmierer".  ;D
Vielleicht hilft es, wenn du das Resultat.
Also das ausgedruckte html postest:
Und zwar den Ist Zustand und den Sollzustand.

Ausserdem werde ich jetzt noch bis 21:00 Uhr im Büro sitzen und morgen auch.

Gruß Axel

CLI_Andreas_Schmidt:
Das ist das jetzige Ergebnis-Code (s. auch Image)

<img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/FA6B9C07E756B113C1256EB4003D3185?Opendocument" target="content" onMouseOver="return toggleMenu('menu1')">Drawings BRG</a><br><SPAN id='menu1'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/BA9AF6A4C4A6B498C1256ED1003FEE8A?Opendocument"  target="content" >Antwort 1</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/D8082EC5BCAECB7DC1256ED1003FF207?Opendocument"  target="content" >Antwort 2</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/3056D2F624438664C1256ED1004712E3?Opendocument"  target="content" >Antwort 3</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/E441C399C72F371DC1256ED1004B7A65?Opendocument"  target="content" >A 4</a><br></SPAN><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/FE6C427EF74FE38EC1256E640033B374?Opendocument" target="content" onMouseOver="return toggleMenu('menu2')">Drawings ECS</a><br><SPAN id='menu2'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/836406AFAFD9030FC1256ED100400459?Opendocument"  target="content" >Antwort 1</a><br></SPAN><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/156E1321C7FAC46FC1256E6400319726?Opendocument" target="content" onMouseOver="return toggleMenu('menu3')">E-Learning Center</a><br><SPAN id='menu3'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/7ADF7E4FCEA7FB97C1256ED10040091C?Opendocument"  target="content" >Antwort 1</a><br></SPAN><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/1ABDCF1F3B4FA448C1256E6F0036F114?Opendocument" target="content" onMouseOver="return toggleMenu('menu4')">Engineering Projects</a><br><SPAN id='menu4'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/15C48FDFBAD11EA1C1256ED100400EF2?Opendocument"  target="content" >Antwort 1</a><br></SPAN><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/8502E4A764C5F144C1256E640031835D?Opendocument" target="content" onMouseOver="return toggleMenu('menu5')">Factory Services</a><br><SPAN id='menu5'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/5F3C97EDB5D06F84C1256ED100401587?Opendocument"  target="content" >Antwort 1</a><br></SPAN><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/E11A948CEDC0B5E2C1256E64003376B8?Opendocument" target="content" onMouseOver="return toggleMenu('menu6')">Intranet Services</a><br><SPAN id='menu6'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/3AA4FF89A61214C3C1256ED10041CAE4?Opendocument"  target="content" >Antwort 1</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/2DE29743B4DB610CC1256ED10041D014?Opendocument"  target="content" >Antwort 2</a><br></SPAN><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/16771DA7C80F7889C1256E640033D67E?Opendocument" target="content" onMouseOver="return toggleMenu('menu7')">Miscellaneous</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/C8487F6AB88F6776C1256E640033C352?Opendocument" target="content" onMouseOver="return toggleMenu('menu8')">Project Bluemilk</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/C6131B6D45203BEBC1256E77003419CF?Opendocument" target="content" onMouseOver="return toggleMenu('menu9')">Projekts</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/96AB2FF6FE8097B9C1256E640031A9B2?Opendocument" target="content" onMouseOver="return toggleMenu('menu10')">Sales Tools</a><br><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/FAD8BCD968FD94F6C1256E6400339EC9?Opendocument" target="content" onMouseOver="return toggleMenu('menu11')">Technical Data BRG</a><br><SPAN id='menu11'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/BEF59A7FC7958B79C1256ED1003FFEB9?Opendocument"  target="content" >Antwort 1</a><br></SPAN><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/ECBF772126880149C1256E640033942F?Opendocument" target="content" onMouseOver="return toggleMenu('menu12')">Technical Data ECS</a><br><SPAN id='menu12'><img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/E49BCEDE010D2D4AC1256ED1003FF7A3?Opendocument"  target="content" >Antwort 1</a><br></SPAN>


Und das ist das Script, das dieses Ergebnis erzeugt.

Sub Initialize
   Dim s As New NotesSession
   Dim db As NotesDatabase
   Dim v As Notesview
   Dim doc As NotesDocument
   
   Dim stringvarend As String
   Dim navdoc As NotesDocument
   Dim response As NotesDocument
   Dim area As String
   Dim konfview As NotesView
   Dim konfdoc As NotesDocument
   Dim col As NotesDocumentCollection
   Dim i As Integer
   
   i = 0
   
   
   
   Set db = s.CurrentDatabase
   Set v = db.GetView("content")
   Set doc = v.GetFirstDocument
   
   Set konfview = db.GetView("konfnav")
   Set konfdoc = konfview.GetFirstDocument
   
   If Not (konfdoc Is Nothing) Then
      Call konfdoc.Remove(True)
   End If
   
   While Not (doc Is Nothing)
      
      If doc.form(0)="area" Then
         i = i + 1
         
' Schreibt den ersten Link mit dem Subject aus dem Hauptdokument
         stringvar = stringvar + {<img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/}   & doc.uniqueid(0) & {?Opendocument" target="content" onMouseOver="return toggleMenu('menu} & i & {')">} & doc.a_area(0)  & {</a><br>}
         
' Das erste Antwortdokument zum Hauptdokument laden   
         Set response = v.getchild(doc)
         
         If Not (response Is Nothing) Then
            stringvar = stringvar + {<SPAN id='menu} & i & {'>}
         End If
         
         While Not ( response Is Nothing )
            
            stringvar = stringvar + {<img src="pfeil.gif"><a href="http://spsrv1/igusIntranet80_b.nsf/content/}  & response.uniqueid(0) & {?Opendocument"  target="content" >}  & response.CSubject(0) & {</a><br>}                                 
            
            Set response = v.GetNextSibling( response )
            
            If (response Is Nothing) Then
               stringvar = stringvar + {</SPAN>}
            End If
            
         Wend
         
      End If
      
weiter:
      
      stringvarend = stringvarend + stringvar
      stringvar=""
      
      Set doc = v.GetNextDocument(doc)
      
   Wend   
   
   Set navdoc = db.CreateDocument
   navdoc.form = "konfnav"
   navdoc.label = stringvarend
   Call navdoc.save(True,True)
   
   
End Sub


Puh.... man ist das hartnäckig.



CLI_Andreas_Schmidt:
Hi Axel,

ich bin jetzt selbst bis zur Kommentar-Ebene gekommen. Um 23.45 Uhr hatte ich die Lösung.

Ich denke ich komme jetzt für die weiteren Ebenen selbst klar.

Gruss

Andreas:

PS: Danke für die Hilfe ---- Leider warst Du einer der Einzigen, die sich zu meinem Problem geäußert hatten. Schade. Mein Problem sollte doch nicht so selten sein und Lösungen gibt es bestimmt schon.

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln