zondag 15 november 2009

Eerste ervaring met de Asics Trabuco 12 WR

Vorige week heb ik mijn nieuwe trailschoenen gekregen, door omstandigheden pas dit weekend voor het eerst kunnen gebruiken.
Vandaag ben ik naar de Nedereindse plas gereden, daar ligt rondom de skibaan een mtb route van zo´n 4 kilometer lengte.

Ik heb de route zo'n 2,5x gelopen. Weer was niet echt lekker, regen en harde wind.
Maar daardoor heb ik wel een goed gevoel gekregen hoe het is om op trailschoenen te lopen.

Mijn ervaringen
  • De hele schoen is stuk stugger, merk ik voornamelijk bij de enkel, wel even wennen.
  • Zijkant van de zool is blijkbaar iets scherper, want ik had binnen kant van mijn enkels open gehaald. Volgende keer langere sokken aan.
  • Profiel is even wennen, maar als je eenmaal door hebt dat je veel grip hebt is vooral het dalen een stuk makkelijker. En je voelt bijna geen stenen door de zool heen

Al met al ben ik dus zeer tevreden, was natuurlijk nu nog maar een kleine 10 kilometer.
Volgende keer maar wat langer.

dinsdag 10 november 2009

View URL in Xpages in the Client

I'm busy with a highly configurable FAQ database build with XPages.
The custom styling of the website is based on a Notes document, who is containing the styles.
I'm using relative url's like,
href="/css/e-office.css"

When I load the application in the Client then my styling is broken.
In the source I see a weird URL for my stylesheet.
href="/xsp/Paddington%20R8!!bb/faq.nsf/xsp/css/e-office.css?SessionID=ID12-147ef17222171000"

There is in the url een extra 'xsp' before the /css/e-office.css
How can I avoid this, because I think this is the cause that my stylesheet is not properly loaded in the client.

zaterdag 7 november 2009

How to get Content of Stylesheet design element ( Update )

Yesterday I was asking a way to get the content out of a Stylesheet Design element, see
previous post.
Thanks to Tim Tripcony I solved the problem.
Solution
First of all I downloaded the base64 class from this website.

Then I created the function 'getStylesheet'
Dim nc As NotesNoteCollection
Dim domParser As NotesDOMParser
Dim docNode As NotesDOMDocumentNode
Dim base64 As New Base64()

Dim stream As NotesStream, stream1 As NotesStream
Dim exporter As NotesDXLExporter

Set nc = db.CreateNoteCollection(False)
nc.Selectstylesheetresources=True
Call nc.BuildCollection

Set stream = session.CreateStream
Set stream1 = session.CreateStream

Call stream1.Truncate

Set exporter = session.CreateDXLExporter(nc, stream)
Call exporter.Process

Set domParser=session.CreateDOMParser(stream, stream1)

Call domParser.Serialize
Call domParser.Process
'get the document node
Set docNode = domParser.Document

Call findFileData(domParser, docNode)

GetStylesheet = base64.decode(stream1.Readtext())

Call stream.Close()
Call stream1.Close()
End Function


And a function 'findFileData', to loop through the DOM Nodes and generate the content of the FileData Tag as DOMParser output.

Function findFileData ( domParser As NotesDOMParser, node As NotesDOMNode) As string
Dim child As NotesDOMNode
Dim elt As NotesDOMNode
Dim attrs As NotesDOMNamedNodeMap
Dim a As NotesDOMAttributeNode
Dim LF As String
LF = Chr(13)+Chr(10)

If Not node.IsNull Then
Select Case node.NodeType
Case DOMNODETYPE_DOCUMENT_NODE: ' If it is a Document node
Set child = node.FirstChild ' Get the first node
Dim numChildNodes As Integer
numChildNodes = node.NumberOfChildNodes

While numChildNodes > 0
Set child = child.NextSibling ' Get next node
numChildNodes = numChildNodes - 1
Call findFileData(domParser, child)
Wend
Case DOMNODETYPE_TEXT_NODE: ' Plain text node
If(node.Parentnode.Nodename="filedata")Then
domParser.Output(node.NodeValue+LF)
Exit function
End If
Case DOMNODETYPE_ELEMENT_NODE: ' Most nodes are Elements
Set elt = node

Dim numAttributes As Integer, numChildren As Integer
numAttributes = elt.attributes.numberofentries

Set attrs = elt.Attributes ' Get attributes

Dim i As Integer
For i = 1 To numAttributes ' Loop through them
Set a = attrs.GetItem(i)
Next

numChildren = elt.NumberOfChildNodes
Set child = elt.FirstChild ' Get child
While numChildren > 0
Call findFileData(domParser, child)
Set child = child.NextSibling ' Get next child
numChildren = numChildren - 1
Wend

Case Else:

End Select 'node.NodeType
End If 'Not node.IsNull
End Function


In the function 'getStylesheet' I run the code
GetStylesheet = base64.decode(stream1.Readtext())

to return the decoded text.

vrijdag 6 november 2009

How to get Content of Stylesheet design element

I have a database who have one stylesheet design element.
With Lotusscript I try to get the content of this design element.

The code who gets the design element is below:

Set nc = db.CreateNoteCollection(False)
nc.Selectstylesheetresources=True
Call nc.BuildCollection

nid = nc.GetFirstNoteId()
Set docCSS = db.GetDocumentByID(nid)

When I look in the debugger at the items then there is not an item who contains the content.

Is there an other way to get the content of this design element?