Lotusphere – Jumpstart day

Here is a summary of my experiences on Jumpstart day:

JMP301 Masterclass: Defence against the dark arts

Although an administrator session I thought it would be good to hear a bit more on Notes security. On the other hand the jumpstart sessions for application development sounded too simple to me.

The session was great (and fun listening) and it was good to hear about the measurements available Notes to secure the system.

What I took out of the session was more to create more security awareness among our developers. I guess this will result in some kind of workshop we have to setup.

Anyway, when I told my admin that I visited an admin session he was proud but I did not get a reply when I stated that he should now at least attend one developer’s session =)

Rated: 10

 

JMP 304 Masterclass Deep Dive into Calendaring and Scheduling

Again an admin session. The purpose of this attendance was to understand Calendaring and Scheduling and hear of opportunities how to embed calendaring and scheduling in other Notes applications.

To my opinion the session went much into problem tracking so that was a bit disappointed.

Anyway, again I made my admin proud but still no answer on my question which developer session he will attend.

Rated: 6

 

Lotus stuff store and Bookstore

‘Vikings’ never return home without treasures so I paid a visit to the stuff store/bookstore to check if there was something of my taste. Any way I succeeded. I also noticed that the ‘Mastering XPages’ book is amazingly thick and this will truly become the bible in the new age of Domino development.

Some great other titles in the bookstore but at my next visit I will bring my axe and slayer and go a little berserk on some free shopping ;-)

Rated: 10

 

 

JMP303 Masterclass LeveragingJSON in both Client and Server Side JavaScript

The description sounded interesting ( I even skipped an admin session for this one!) but when they started with adding a Notes View on a Notes Page surrounding with brackets and adding an empty entry at the end I was thinking:

Does IBM allow the promotion of such approaches while XPages is the preferred technology to be used?

Anyway, in the second part the speakers came with some XPages examples but they never recovered from the weak start.

I believed the description also talked about JSON in the client but that turned out to be running XPages in the Notes client.

Rated: 5

 

Welcome reception

Free drinks & food, some entertainment on the background, a nice evening temperature and a lot of Notes geeks!

Rated: 10

Lotusphere sessions videos

In the LS goodies bags you can find an order form for LS sessions on DVD. While other events are available online for free (MIX, WWDC, I/O) Lotusphere is still available with restrictions for a considerable price.

Maybe a vote on Tommy’s idea is a clear signal at the right moment. Even when we enjoy the weather in Florida, the sessions and the social contacts, we want information about our technology to be available to everyone. And with saving our planet a bit by not having to buy plastics…

 

 

!NO! more struggle with XPages as RSS source and JWPlayer

I am working on embedding JWPlayer in a Domino app and I want to use an XPages to generate an RSS feed for a playlist. Via this way I can apply some ‘intelligence’ and direct which related items the playlist should contain. How the code should look like you can see here.

The problem I am facing at the moment is that JWPlayer has problems using a source that is based other that the xml extension.

Task Queue failed at step 5: Playlist could not be loaded: XML could not be parsed or playlist was empty

Whenever I save the .xsp results as an .xml file and add it to the application as a file resource and call it the player works fine.

In traditional Domino development it is possible to call an agent e.g. rss.xml but XPages does not allow it, it can only contain numbers, letters, underscore and hyphen.

  • Do you see any options using XPages or am i thrown back to writing an agent?

Update: problem solved as you can see in the image below.

Q2: Use an XPage as RSS source

Thanks for all the help I got on this post. However I have some remaining questions how to build an RSS feed based on an XPage.

Here is the code so far:

/******************** START SAMPLE CODE ********************/
var con:javax.faces.context.ExternalContext = facesContext.getExternalContext();
var response:com.ibm.xsp.webapp.XspHttpServletResponse = con.getResponse();
var writer = response.getWriter();

response.setHeader(“Cache-Control”, “no-cache”);
response.setContentType(“text/xml”);

writer.write(“<?xml version=\”1.0\” encoding=\”utf-8\”?>”);

var domDoc:DOMDocument = DOMUtil.createDocument();

var rootNode:DOMElement = domDoc.createElement(“rss”);
rootNode.setAttribute(“version”, “2.0”);

var channelnode:DOMElement = domDoc.createElement(“channel”);
rootNode.appendChild(channelnode);

var itemnode:DOMElement = domDoc.createElement(“title”);
itemnode.setStringValue(database.getTitle());
channelnode.appendChild(itemnode);

var itemnode:DOMElement = domDoc.createElement(“description”);
itemnode.setStringValue(“Broadcast your daily business”);
channelnode.appendChild(itemnode);

var itemnode:DOMElement = domDoc.createElement(“link”);
itemnode.setStringValue(“http://&#8221; + @Name(“[CN]”,session.getServerName()) + “.domain.com/” + @ReplaceSubstring(database.getFilePath(),”\\”,”/”));
channelnode.appendChild(itemnode);

var v:NotesView = database.getView(“$v-rss”);
var doc:NotesDocument = v.getFirstDocument();
var counter=0;

while ( doc != null && counter < 20){

var itemnode:DOMElement = domDoc.createElement(“item”);
channelnode.appendChild(itemnode);

var node:DOMElement = domDoc.createElement(“title”);
node.setStringValue(doc.getItemValueString(“Tx_MovieTitle”));
itemnode.appendChild(node);

var node:DOMElement = domDoc.createElement(“pubDate”);
var dt:NotesDateTime = doc.getCreated();
node.setStringValue(dt.getDateOnly());
itemnode.appendChild(node);

var node:DOMElement = domDoc.createElement(“description”);
var descr = “File: “+ doc.getItemValueString(“Tx_DspMovie”) + “. Description: ” + doc.getItemValueString(“Tx_MovieDescription”);
node.setStringValue(descr);
itemnode.appendChild(node);

var node:DOMElement = domDoc.createElement(“link”);
node.setStringValue(“./0/” + doc.getUniversalID() + “?OpenDocument”);
itemnode.appendChild(node);

var node:DOMElement = domDoc.createElement(“author”);
var person = @Name(“[Abbreviate]”,doc.getItemValueString(“Na_MovieAuthor”));
node.setStringValue(person);
itemnode.appendChild(node);

var node:DOMElement = domDoc.createElement(“guid”);
node.setStringValue(doc.getUniversalID());
itemnode.appendChild(node);

var counter = counter + 1;
var tmpdoc = v.getNextDocument(doc);

doc.recycle();
doc = tmpdoc;
}

domDoc.appendChild(rootNode);

writer.write( domDoc.getXMLString() );
writer.endDocument();
facesContext.responseComplete();
/******************** END SAMPLE CODE ********************/

 

Questions I have:

  • How to get the dates in RFC 822 format? Anyone know a variant for the following LotusScript:

‘Mike Golding’s code
Function RFC822DateFormat(aDate As NotesDateTime) As String
Dim vRFC822 As String
Dim vSign As String
Dim vZoneOffset As Integer
Dim vZoneOffsetH As String
Dim vZoneOffsetM As String
‘CREATE A GMT VERSION OF THE DATE
Dim bDate As New NotesDateTime(aDate.LSGMTTime)
‘FORMAT LOCAL DATE TO UTC
vRFC822 = Format$(aDate.LSLocalTime, “ddd, dd mmm yyyy hh:nn:ss”)
‘WORKOUT THE TIMEZONE OFFSET FROM GMT
vZoneOffset = bDate.TimeDifference(aDate)/3600
‘GET OFFSET POSITIVE OR NEGATIVE
If vZoneOffset > 0 Then vSign = “-” Else vSign = “+”
‘OFFSET HOURS
vZoneOffsetH = Right(“0” + Cstr(Int(Abs(vZoneOffset))),2)
‘OFFSET MINUTES
vZoneOffsetM = Right(“0″ + Cstr(Fraction(vZoneOffset)*60),2)
‘RETURN FULLY FORMATTED DATE
RFC822DateFormat = vRFC822 + ” ” + vSign + vZoneOffsetH + vZoneOffsetM
End Function

  • In case my RSS contains HTML how to include CDATA? The following code is valid but does not give the wanted result:

var node:DOMElement = domDoc.createElement(“description”);
var descr = “!&lt;[CDATA[File: ” + doc.getItemValueString(“Tx_DspMovie”) + “. Description: ” + doc.getItemValueString(“Tx_MovieDescription”) + “]]&gt;”;
node.setStringValue(descr);
itemnode.appendChild(node);

JWPlayer – Anyone solved how to generate the player embed codes on a Domino server?

I have come quiet far with my XPagified version of OpenTV. I am using the JWPlayer which work excellent. Right now I am looking for a way to generate player embed codes so you can link from other websites to the application. This feature can be pretty vital for good re usage of the app.

However the integration example is based upon PHP.

So I am wondering if someone has already taken a look at this before and is willing to share a solution for the Domino server?

Some screens:

Spotlight on your startscreen: available @OpenNTF

I have embedded the code in AppDev Template project on OpenNTF. This application can be used as the default template for new development projects for the Lotus Notes client.

You can download version 2 of it here.

Notice that dates are displayed in a more human friendly format:

Class DateHelper
Private dt_then As NotesDateTime
Private dt_now As NotesDateTime
Private diff_in_seconds As Long
Private diff_in_minutes As Long

Sub New()
Set dt_now = New NotesDateTime(Now)
End Sub

Function TimeSince(datetime As Variant, includeseconds As Boolean)
Set dt_then = New NotesDateTime(Cstr(datetime))
Dim future As Boolean
Dim since As String
Dim whichway As String

diff_in_seconds = dt_now.TimeDifference(dt_then)

If Sgn(diff_in_seconds) = -1 Then ‘future
future = True
diff_in_seconds = Abs(diff_in_seconds)
whichway = ” away”
Else ‘past
future = False
whichway = ” ago”
End If

diff_in_minutes = Round(diff_in_seconds/60,0)

If diff_in_minutes >= 0 And diff_in_minutes <= 1 Then
If Not includeseconds Then
If diff_in_minutes = 0 Then
since = “less than a minute”
Else
since = “1 minute”
End If
Else
If diff_in_seconds >= 0 And diff_in_seconds <= 4 Then
Since = “less than 5 seconds”
Elseif diff_in_seconds >= 5 And diff_in_seconds <= 9  Then
Since = “less than 10 seconds”
Elseif diff_in_seconds >= 10 And diff_in_seconds <= 19 Then
Since = “less than 20 seconds”
Elseif diff_in_seconds >= 20 And diff_in_seconds <= 39 Then
Since = “half a minute”
Elseif diff_in_seconds >= 40 And diff_in_seconds <= 59 Then
Since = “less than a minute”
Else
Since = “1 minute”
End If
End If
Elseif diff_in_minutes >= 2 And diff_in_minutes <= 44 Then
since =  Cstr(diff_in_minutes) + ” minutes”
Elseif diff_in_minutes >= 45 And diff_in_minutes <= 89 Then
since = “about 1 hour”
Elseif diff_in_minutes >= 90 And diff_in_minutes <= 1439 Then
since = “about ” + Cstr(Round(diff_in_minutes / 60, 0)) + ” hours”
Elseif diff_in_minutes >= 1440 And diff_in_minutes <= 2879 Then
since = “1 day”
Elseif diff_in_minutes >= 2880 And diff_in_minutes <= 43199 Then
since = “about ” + Cstr(Round(diff_in_minutes / 1440, 0)) + ” days”
Elseif diff_in_minutes >= 43200 And diff_in_minutes <= 86399 Then
since = “about 1 month”
Elseif diff_in_minutes >= 86400 And diff_in_minutes <= 525599 Then
Since = Cstr(Round(diff_in_minutes / 43200, 0)) +” months”
Elseif diff_in_minutes >= 525600 And diff_in_minutes <= 1051199 Then
Since = “about 1 year”
Else
since = “over ” + Cstr(Round(diff_in_minutes / 525600, 0)) + ” years”
End If

TimeSince = since + whichway
End Function
End Class

Let’s try to set a new download record in 2011 =)