Showing posts with label Domino. Show all posts
Showing posts with label Domino. Show all posts

Monday 15 October 2012

Coping with Windows update 2661254 SSL FIx on a self certed domino server

Well well well, that was an interesting couple of days!
Microsoft in their infinite wisdom decided to release a fix that stops Internet Explorer (a pox on it) accessing any SSL site that has a <=512bit certificate.

Here is a link to the MS document

Now there are very good, sound and security related reasons for MS to do this but it did cause me some fretting and sleepless nights this week, i have no doubt once the fuss dies down you will see Firefox, Opera, Safari and the rest follow suit.

We protect a lot of our internally accessed data with self certed SSL certificates and these where created back in the days when 512 bytes was more than ample and secure for this purpose. These certs were renewed each year and over time have been forgotten about.

The symptoms of the problem post this fix being applied are:-

When IE <=8 tried to connect you get a "there is a problem with the web site" error and you can go no further, with IE >=9 you get the "There is a problem with the certificate" message but clicking on the "Proceed to the web site (not recommended)" does nothing.

Now on a i5 server (used to be the iSeries Server or AS400 and nicknamed iBoxes) renewing a self certed SSL server certificate is dead easy and you get the option to change the bit length so for our iBoxes it was dead easy. Admin Panel, renew certificate, change bit length, create, apply , restart server .. and the problem went away.

But Domino servers ... ahhhh ....

I went into the Certificate authority NSF created for the server, tried to create a new certificate, not a problem but no field to let me change the key length.. ARRRRRRGGHHHHHHH!!! Tried a whole lot of things to get a 1024 long key, with no great success. So my quickr users on the one server with the problem had to start using another browser whilst I sorted this problem out.

As it turns out Per Lausten Domino Guru and all around nice chap tweeted a link that lead me to the solution ...many thanks Per!!! Once again Social Networking helps the poor benighted admin out of a tight corner not really of his own making.

Basically what I did was the following which I was missing in the other ways I tried
The full details for what follows are on the link above, but in summary you just start from scratch.

01. I took a copy of the original Cert Authority NSF created for the server
02. I took a copy of the .key and .sth files currently in use on the server
03. I created a new nsf using the Domino Certificate Authority template CCA50.ntf
04. I created a new CERTIFICATE AUTHORITY KEY RING FILE with a 1024 bit key (option 1)
05. I ran the Configure Certificate Authority Profile (option 2) for the new key ring file
06. Set the expiry to 5 years
07. I ran option 3 - Create Server Key Ring & Certificate, filled in the guff required paying special attention to put CAKeyPair in as  the CA Certificate Label and the fully qualified domain name of the server as the "Common Name" and 1024 as the key length.

Et Voila!!! I have a new Keyfile.kyr and KeyFile.sth with 1024bit keys!

All that was left was to copy these to the server and stop and start the HTTP task and IE started to work again, which was accompanied by a massive sigh of relief and a couple of memo's suggesting we might as well go the whole hog and get "real" certificates even thought they cost money.

Thanks again Per for the link that got this sorted you are a star!

Tuesday 10 August 2010

Single authenticated point of entry to iNotes for all your users

It has been a while since I did a Domino Geek posting, however I came across this today and thought I would share it. Basically you can if you know the URL get into your Lotus Notes eMail via a browser. The problem is that most users can be .. well .. forgetful and having to remember a big long string of characters is a bit of a pain that and we wanted a single URL that would (a) authenticate the user and (b) open the mail file so we came up with this solution.

*Edit* It has been pointed out in the comments that there is a "Redirect" function  built into notes, there is and it very useful, however it does require some work on each server and when you have lots of servers in remote locations using different languages and to be honest I wanted a simple one stop shop, replicate it to all servers when needed. what follows is an alternate to, but not necessarily better than what is provided naturally **

A single NSF with a short URL  http://[yourserver]/wmg.nsf/wmail.html
This launches a page that looks like this

The user logs in and if successful their mail file opens.

So how did I do this?

A) When the Button on form on the page is clicked a call is set up to
names.nsf?login with the PostData set up with the userid and password
most importantly there is also a "REDIRECTTO=" parameter in the PostData that directs (on successful authentication) to an agent called OPENMAIL

B) The call to the url with the postdata is sent to the server via an AJAX call

C) If the authentication fails the AJAX call receives the default login page, and an error msg is sent to the user

D) If authentication is sucessful the REDIRECTTO parameter is called directing the browser to the OPENMAIL agent.

E) The OpenMail agent does a look up on the NAB and extracts the mail file name for the user

F) The URL that will open the user's mail file is constructed on the server and returned to the browser as a JSON variable.


G) The URL is used in some JS to change the location.href, and since the browser is now authenticated the mail file opens.(in this case in LITE mode you can tweak the code the way you see fit)


Simples...

Proper un-encrypted and ACLed file


Download .. stick in the data dir of your server, sign it, sign it again (just to be sure) and got to http://[yourserver]/wmg.nsf/wmail.html or add the link to your intranet 

Enjoy

Sunday 24 May 2009

A rogue pair of FLEX purple underpants have mounted an assault on the yellow-only wash of my lotus web dev laundry

I have been a bit remiss with the Flex series I started a while back and I do apologise for the discontinuity and I have started doing some more examples that I will pop up on here in the next few days.

There is a part of me that is a wee bit ... embarrassed is not the right word ... concerned is perhaps better ... that whilst the movers and shakers in the Domino world are "Doing it" the Xpage way I have veered off into another RIA technology.

I have never been a fanboy of any particular technology I am more inclined to use the tools that I have access to and which get the job done. Now I have had a bit of a play with X-Pages and they are indeed a wonderful if slightly not-quite-there-yet thing. As the new Domino techniques develop I have found myself moving towards a place where Domino is a back end data store, like DB2, MySQL or Oracle

I am not sure quite why I this is happening, but technologies & frameworks like AJAX, FLEX etc do take a fair bit of the drudgery out of coding for the web. I found that it was easier to have a slight dichotomy between the app as seen on the web and the app as seen in the notes client rather than to have to make concessions in one or the other for the sake of conformity.

Taking this approach also means I can deliver web apps for a broader range of server installs. Back to V6.* rather than confine myself to V8.* servers thus giving more of my user base a nice warm feeling of being included in the "new" stuff.

This is not to say that I am leaving all of the tools of Notes/Domino behind. I still use Domino Security, Author and Reader fields and loads of LS and JAVA based agents to provide the data handling facilities.

I suppose that another reason that I am heading in this direction is that Domino does not exist in isolation in my sphere of reference. It exists along side data silos in DB2 and Oracle which in the client we can now leverage with Live text linking to composite apps, widgets and side bar apps in the 8* client, which is of course marvellous for those folk on the Full Version 8 client. In the real world where I code not all my users are on V8 and it will (given the current economic climate etc etc) be some time until some of the non-power users have the tin capable of running the full client to its full advantage. In the interim so as not to exclude these users from the momentum of change, I will use the power of non-yellow-tech then it seems prudent to do so.

In several conversations I have had on this topic, there has been an air of disapproval from some that I am at snubbing all the work done to improve things on the platform in the last couple of years. I do not think that I am , I leverage the best for my users with the tools that I have and the facilities they have to use it, if that appears "disloyal" well so be it. I am paid to service my users not some ethereal dogma of yellow oneness. ;-)

For those of you not yet on Version 8 and perhaps held back by budgetary constraints my message would be that you can move forward if you step outside what some refer to as "the bubble" and look at other methods that will maintain your creative momentum with the tools and servers you have to hand.

Monday 16 March 2009

RIA's xpages and Flex

I have of late being experimenting with Adobe Flex and xPages in V8.5.0 with a view to creating Rich Internet applications (RIAs). I started with both at roughly the same time and have spent roughly the same amount of effort on both. Now I have to stress I am not an expert in either so this is an opnion based on my experiences to date rather than an indepth exploration of the pros and cons of one or the other.

To be fair it is a bit of an "apples" and "oranges" comparison xpages is aimed (at the minute) fair and square at Domino Data and Domino apps where as Flex is data source agnostic, if you can get JSON or XML out of a data source Flex will be able to play with it.

Both Flex Builder 3 and xPages are based around Eclipse so the IDE is pretty much the same and there is no real difference when faced with developing in either. You can develope Flex apps in Notepad (or my favourite Notepad++) and use the Flex SDK to compile your project up but this is for REAL geeks!)

In Flex Builder you design your UI by dragging and dropping components from a palette onto the design area. there are 65 components and you can also create your own Custom Components. On an xPage same sort of idea except you only have a palette of 26 components.
and here comes my first whinge about xpages. It is a domino product, loads of apps have a requirement for a NAB lookups but no Name Picker in the components, you have to build your own using one or more of the databinding form components which isnt that hard but hey it would be nice to have a drag on one to save all the bother of doing that.

Flex has chart controls and OLAP grid control and two types of data grid and all sorts of interesting things xpages at the minute in 8.5.0 has either not got them or has them but you cant tweak them as much.

Which brings me to visual tweaking in xpages you have to play with the CSS and preview in all your target browsers to see what it looks like, in Flex you design on the screen and thats what it looks like for the user. Again some might say this is an unfair comparison as the two technologies are totally different and yes I accept that, but to drag and drop and tweak is easier and quciker than drag drop fiddle with CSS and preview.

I also have a fear that a lot of xpages are going to stay with the oneUI css and will suffer from the generic Xpage "look". This certainly makes development easier if you do that, but for me will start to wear thin as a look after a while. "themes" certainly sound like the answer but I have had all sort of bother getting a floating and fluid xpage to stick together and display on the browser with any sort of sucess.

Xpages bind to the back end domino data really well and with a minium of fuss and bother which is really sweet, and the new JS impliemented @commands are fantastic, needless to say Flex has none of these facilities nor ever will and xPages wins hands down in this respect as you have to build agents to serve the XML or JSON to the Flex App or take POSTED data and apply it, whilst not difficult it is time consuming and you don't have to do it in xPages.

There is a bit of learning curve for both Flex and xPages when adding the code that goes behind the buttons and switches etc and it is much of a muchness there in that they are equally difficult/easy to pick up the basics.

You need a V8.5 server and V8.5 Designer to create and run xpages, you can leverage Flex from any Domino server that serves up XML or JSON, which I believe is way back to 6.5 or before. I can hear some of you say "...but you MUST be on V8+ to be on anything less is just silly." well yes but there is and it seems has been an intertia in some if not all Domino sites to be one or two versions behind the cutting edge. At the minute those that have not upgraded could leverage Flex based UI's but can't leverage xPages. I would of course recommend all readers to upgrade :-) Version 8+ it is really very good.

Xpages of course is not dependant on the browser having any plugins flex needs Adobe Flash Player 9 or 10. However even allowing for Adobe's hyperbole the flash player does seem to be pervasive in the installed browsers attaching to the internet.

There doesn't appear to be any difference speed wise from a user perspective, although I would hazzard a guess that Flex is more bandwidth intensive when getting data from the server for views.

In conclusion having used both for around 3 months, I feel considerably less constrained in the way I design a RIA when I use Flex. Xpage development is locked in much closer to the domino data and is less flexible as a result. (or so it seems)

I am not giving up on Xpages ... as it matures, as I am sure it will, it will become much more of a lived in "environment" and better for it, however it would be foolish to overlook an environment that gives a better and more adaptable over all "finish" to a RIA.

This is of course my opnion, but I would suggest you have a look a Flex, particularly if you are stalled (for what ever reason) on version 7* or 6.5* with no immeadiate plans or budget to move up to Version 8*.

Tip of the Day- A JS way to create inline images to display from attachments in a Rich Text Field

Here is a wee Domino related JS tip.

Say you have a RT field into which users can attach files, these will in the natural schemem of things appear as a list of attachments with nice icons to click on. But what if you want to display them but couldn't be arsed coding in the domino bit of the form to get them to display as inline images.

01. Put a DIV tag around your RT field and give it an ID


<div id='imageRT'>[DominoRTField]</div>


03. Create an empty target [div] to display them in


<div id='imageDsp'></div>


04. Create a JS function in the form or page like this

function dspLinks()
{
target = document.getElementById("imageDsp");
imgLinks = document.getElementById("imageRT").getElementsByTagName("a")
for(t=0;t<imgLinks.length;t++)
{
imgLink = imgLinks[t].href;
img = document.createElement("img");
img.src = imgLink;
target.appendChild(img)
}
}


04. Put your dspLinks() function in the onload of the form and voila you have all the images in your RichText field displayed in the target div as well as the normal link icons you get from a RT Field's attachments.

Thursday 12 March 2009

Introducing the "Blue Skills" job site for IBMers

Okey Dokey.. here is a thing

Mr Mooney over at pmooney.net has just blogged a rather interesting prospect. He describes it way better than I will and with a lot less swear words. So take a trip over and have a look see both at Paul's post and at the beta site. Which Kevin Pettitt is currently trying to break.

To quote Paul
About a year ago, staff in Bluewave/BE Systems were discussing recruitment sites in general. Although mostly positive, the problems associated with them typically centred around inaccurate job specifications and vague applicant details. Also we noticed that there was a general inability to ask questions relevant to our specific areas of interest. We toyed with the idea of creating a dedicated careers site in the Big Blue field, focusing on finding the right people for the right jobs in our professional area.
Take a lookie see ;-)

Sunday 15 February 2009

Domino.Doc what IS the way forward?

Hmmmmm.. there have been a few post LS posts about Domino.Doc and Version 8.*
and to be honest I am confused. Domino.Doc obviously had a limited life as can be seen by the purchase of the Aprix CMS by IBM, which was Domino Based but now appears to have been sucked into Portal.

So wither Domino CMS? Ah Ha! you might exclaim , that's where Quickr comes in. Indeed so , but the basic Quickr toolset is not quite as feature full as the old Domino.Doc was particularly in the workflow engine. You may counter with well there are Quickr connectors to Filenet and IBM Content Manager ... yes indeed there are but again they are in Websphere not Domino..

I notice I am not alone in my concern.... Patrick Picard mentions a slightly different and for him more pressing problem.

I have had a look see on IBM.com and for the life of me I cannot find anything that defines where Domino.Doc users go now, other than in the broadest of terms and I am left wondering where does all the Domino.Doc data silo'ed in domino servers go now? Do we keep the Domino.Doc server @ V7 whilst the rest of the organisation skips gayly into Version 8 and beyond?

Perhaps someone out there in the blogsphere knows?

Wednesday 4 February 2009

You can have a play with Twimino V0.0.1 if you want

He ho Peeps.

If you will that way inclined you can have a play with Twimino V0.0.1 ... it is no where near done yet, I have perhaps worked on it for 3-4 hours so do NOT expect loveliness!!! It not all there yet and it is likely full of of bugs.. but it works after a fashion. Thomas's version is slightly different I use the Domino SAX parser and he doesnt (it has to be said his is a good deal more professional than mine, but what the hey ...)

The Twitter API is doing something strange with the DM api and it might take a few refreshes of the agent to see you DMs appear...(they are GREEN in the Friends Time line BTW)

You can download it here. (116k ish)

Once I apply some polish and some more features , friends, searchs, automatic SNURL/SNIP and the like, I will bung it up on OpenNtf for now have a play if you feel that way inclined the code is all LS and is not that difficult to follow.

Once you have done the first Harvest the agent will kick in and run every 5 mins, you may have to press F9 to refresh the view, the friend list builds as you get Tweets in.

Click on a tweet to get the option menu, or right click and use the options you find there.

You can also click on your Friend list to get a menu there.

Non-automatic manual refreshes via the big button on you friends time line

No piccies as yet I am afraid

Tuesday 3 February 2009

Twimino Nearly Ready

I got a bit bogged down in another issue so I am not quite there yet. I still need to do a couple of views and enable a click-up menu of options on the friend list for "Tweet At Twit", "DM Twit" etc

However the underlying guts is all there now.. sort of.













This is what it looks like now in Default view
with the OPTIONS bar closed. Your Friend Time line is displayed in the main body part of the screen with unread marks and message threading where possible (some clients don't do replies and as such the thread gets broken)







This is the Option Bar open where you set your profile, sign the DB turn the harvesting agent on and off it can be slid away when not needed.














When you click on a tweet in your friend's timeline instead of the tweet opening you get this menu which allows you to Send a new TWEET
Reply to the TWEET you clicked on
Retweet the TWEET you clicked on
Or Open the first URL in the TWEET text in your browser














This is your send a tweet dialog, it can copy with new Tweets, Replies and Retweets. (Tomorrow it will get DMs)


All these options are also on the RIGHT CLICK menu for the VIEW

The agent runs every 5 mins to harvest the tweets but you can do manual refreshes using the view's "Manual Harvest of Tweets" button

At the minute the Friend List Auto Populates from the Tweets you harvest

I have a background agent that your can run that harvests "All your followers" "All Someone Elses Followers" and will allow you to add and block chums...but that will be for Version 0.0.2

Anyhows Off to bed for me...

Sunday 1 February 2009

Twitter in an NSF (...continued)

Having had a look at Thomas's Twitter NSF last week. Initially I decided that my own wee app would die a death and I cast it aside. However the TV was that crap this weekend that I fiddled away at it and have moved to a point were 2morrow (hopefully) I will be able to give you my version of the same thing cept mine is called Twimino and looks like this.

I don't have avatar pictures in mine (yet) and it still has some idosyncracies to work out but the V0.0.1 very beta beta should be ready for people to tear to shreds tomorrow or Monday

Thursday 29 January 2009

Twitter in an NSF (follow up)

Yesterday I posted about my playing with twitter in a NSF, since this fiddling came from a request of "how to read XML from an external URL in LS?" I didn't google or PL twitter and NSF and as a result didn'f find out about a fine little app put together by one of our own Thomas Adrian who hales from Sweden. He has got a really sweet little NSF app has matured to Version 2 and does all that I planned to do. So any of you that are interested take a look at his post here.

Kudos Bro!

A fine wee app! Thanks for sharing it :-)

Friday 23 January 2009

Bill Buchan's secret anchestry revealed

Much was said this past week about Mr Mooney's Scottish parentage in that he is indeed the skinny love child off our own Mr Buchan, this may or may not be true and is not really anything to do with this post ... I was reviewing the LS09 Flickr stream and I came across this picture .. go look at it now ... i will wait ... the similarity struck me like large lump hammer wrapped in enlightenment.. I knew exactly who bill looked like and had at once to put pen to paper...before the mood went off me. To Find out what the Feck I am talking about click the button below



Tuesday 13 January 2009

Does anyone fancy tweaking the Blog template with me?

Ben Poole was having a vent about the lack of movement in the "out of the box" templates over on his blog here. I responded there with an idea that post LS when youse folk are all fired up with enthusiasm that if a couple of us got together we could perhaps put some xpages gloss on the blog template.

It would be a learning experience for us all, we could blog about a collaborative development project, how it works and what we are doing and with a nod to professionalism even document our code... (did is say that out loud)

I am not looking for answers now, but think about it and after the fuss of LS has died down drop me an email.. the addy is on the left and lets see what we can do?

Thursday 27 November 2008

Interesting Notes Based Application - DOCOVA

All Notes-ers

I have just had a chat with a Canadian chap Gary Walsh from DLI who have a very interesting product called Docova I must add at this point that this post is not an advert or endorsement! However I did have a few "wow" moments when Gary Demo'ed it for me on Tuesday.

It is a Document Management System that is back ended by Notes NSFs and can be accessed thru the Notes Client and from a browser. It comes with a host of interesting bells and whistles and is priced very reasonably and it is well worth the time to have a look at their site. Particularly the 3 videos in the panel on the right that give a high level explanation/tour of the product.

If you are interested Gary does a good presentation and does not play the "pushy salesman" (an instant turn off for me) so don't be afraid to give him a buzz or drop him a line (contact details on the Docova site)

The "current economic climate" does not allow me at this time to think about a budget for Docova for my own Notes domains but Gary's contact details have gone into the "definitely keep" folder

Saturday 18 October 2008

Create a web based Drag and Drop Calendar

As part of my "spreading the domnio love" I have for the past year or so been a "yoda" to a Notes Developer who wanted to start branching out into more web based apps. Now in typical DYM form fate does not thrust me an apprentice with whom I can share the odd beer at the weekend. Oh NO! My "Luke Skywalker" does not live in Ireland! C'est la vie :-)

Anyway she asked me the other day how she could make one of her CRM calendar facilities a bit flashier and more modern and I like a fool said "why don't you do it in AJAX and while you are at it incorporate Drag and Drop?"
"Oh that would be good" she said "How would I do that?". My bluff was well and truly called! I said I would have a look at it this evening and send her an example over the weekend. After a certain amount of head scratching and asking myself "How would Chris Blatnick do it?" I fired up the DYM PC and started to code.

One of the problems with calendars and domino has been how absolutely SHITE they look on the web and building any sort of functionality into them was a labour of hercules which involved far to much futtering about with $ fields and the like. My non-domino alter ego PHPYouWillYouWill (tm) gave me a stout dig in the ribs and whispered in my ear, go on break the 11th commandment, use the domino server as a back end server and do nearly everything in JS. I know that this in some quarters sufficient for my domino woggle to be ceremonially crushed as LS. However in mitigation my design runs quite happily on servers V6 and above and the Domino Web Server way back then was a bit ... well it was a lot ... EUCK.

The premise of this example is simple, you have two forms Customer which stores customer data and Appt which stores an Appointment with a customer on a particular day. This data needs to be presented in a MONTH view to the user. The users need to be able to schedule a meeting with a customer on a particular day so they also need to be able to
a) Find a customer in the application
b) Drag the customer onto a date cell which will create an APPT form in the back end NSF

I am used to the YUI framework and one of these days I will get all DOJO but for the moment I know what I am doing with YUI and it has a nice easy D&D implementation.
You register the dragable object and target objects, define a couple of handler functions and Robert is your mothers brother.

Now please remember this is a simple app written as an example of "how I would start to" rather than an actual full functioning app and it was written in 3 hours this evening. Anyway it looks like this, (Click on image for a better look see)


A: Controls for moving the viewable month around.
B: Search Bar á la Google that allows typeahead look up of the customers.
C: Results from the search appear here.
D: An Item being dragged from the list to the calendar.
E: As the Customer passes over a calendar cell the cell is highlighted.
F: An existing Appointment in the calendar.

I used YUI 2.2.4. as the framework for the AJAX calls and DOM manipulation.

Like I said it looks kinda better than the ordinary one and isn't all that complicated at all (it took me 3 hours to code up from scratch!) and will run happily on a V6 onwards server you don't need any on the V8 fancy pants stuff and all the YUI stuff is contained in the NSF.

If anyone is interested an uncommented version of the file can be downloaded here.
Download it, Sign it, pop it on your server and goto crm.nsf/calendar.html

If you think it is useful let me know and I will definitely pop the commented version up on OpenNtf (once i have commented it that is!)

Friday 22 August 2008

SPF Finances part of the Belgian Government Choose Notes! Big Win! Well done IBM! Up your hole Ron Herardian

I see from my news feed that SPF Finances Belgium choose Notes for their messaging infracstructure. 35,000 bums in 6000 sites..Way to go Lotus!..
For the non-Franophones here is my appalling translation ...

With 35.000 “mailboxes” to deploy from here mid-December, the SPF Finances undoubtedly becomes the largest user of the Lotus Notes transport in our country.

It was after having installed 6 years worth of electronic letter-boxes to each civil servant (29.000 people) and offices (6.000 sites), ...[not sure about that bit] that the now delighted Louis Collet, directing ICT, the SPF Finances chose Lotus Notes for the renewal of his infrastructure of transport. The project involves an investment of about 4,7 Euro million for the next 5 years, this amount including/understanding the migration, the licences and maintenance.

It is clearly a victory for IBM vis-a-vis Microsoft Exchange which was credited in 2006 by cabinet IDC on the one hand with market with 51% (- 1%) in the integrated collaborative environment against 40% with Lotus (+ 2%). .....

LOTUS YEAH! WE ROCK!

Tuesday 5 August 2008

HELP ! where are the WAS plugins for domino in Version 8.0.1?

Any gurus out there lend a hand please.

Where have the following gone cos I cant find them on our 8.0.1 servers

c:\\data\plugins\plugin-cfg.xml
c:\\data\domino\\w32\

has the WAS plugin ceased to be for notes.

The reason I ask is we want to run one of the servers behind an IIS server and use it as a front end server on the dangerous outside the firewal and the plugin used to relay the data back and forth to the domino server. Anyone done this any tips traps redbooks etc you can point me at would be gratefully received! This is virgin territory for me.

Wednesday 9 July 2008

I had a small lotusbeer event in Singapore

Gentle reader,
yesterday I arrived in hot and steamy Singapore! Let me say that SGP airport is one of the nicest I have travelled through! The plane touched down at 8:00am and I was out of the airport with bags and in a taxi at 8:25. The immigration lady that stamped my passport even smiled at me!

After catching my breath and a few hours ZZZzzzzz.... I met up with Stephan.Wissel local Singaporean Notes Guru and all round nice guy for some Satay,Stingray ,some green stuff which was very nice but i didnt get the name and most importantly (for me) beer. We had a pleasant evening geeking about Notes/Domino stuff and then we dandered (Irish for a slow walk) back to my hotel. It was a very nice evening and most unexpected Thank you Stephan! :-)

The evening was sort of arranged via the good services of this blog, planetlotus and twitter and given that this was the first time that has happened it has left me with a nice warm feeling about the whole "social" networking area. I think that if you are reading this and have not dipped your toes in the whole web 2.0 pond it is well worth it! You meet the nicest people and they talk the same level of geekish as you! :-)

Monday 12 May 2008

Getting back to the URL you where at when you opened a document.

I was explaining this to a junior dev today and thought i would pass it on.

If you have a Web App with one form but 3 views and the document can be opened from any one of the 3 views. How do you get back to the view you where at when you opened the document in the first place?

There are several ways of doing this, this is mine and it uses a session cookie in the browser to do it.

First you need some cookie handling JS in your form or external JS file, Something like this.


function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++)
{
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name)
{
createCookie(name,"",-1);
}

Then on the page/form/view that has a link to a document on it place this is in the onLoad event:

createCookie("goback",location.href,0)

This will create a session cookie (it deletes itself when the current browser window closes) with the current location stored in the cookie.

Then on your form, place a hidden field called BackURL, or something similar, then on the onLoad event of the form have the following

document.forms[0].BackURL.value = readCookie("goback");


This pulls back the last place you were from the browser and stores it on the form.
Finally on your WQS agent you can use this to get back to your original place by

print |[script language='javascript']location.href='|+ThisDoc.BackURL(0)+|';[/script]|

Alternately you could populate a $$Return field with the contents of the cookie and use that
to redirect the form to the place that you were.

Disqus for Domi-No-Yes-Maybe