Showing posts with label Lotusscript. Show all posts
Showing posts with label Lotusscript. Show all posts

Wednesday, 23 November 2011

RSS to XML and FTP Update


Wow!  I actually did some coding in Lotusscript yesterday.  It was actually a pleasure, but not something I would like to do on a daily basis going forward.  It is always nice to dust off some old skills and prove that you can still achieve something worth while and in a timely manner.

Here is the new website.  PMBlogs

My tasks was to simulate Planet Lotus.  As far as I know, there is not a "Planet Project Management" and I would like to collect all of my PM blogs into a single webpage, updated hourly to see the latest blog entries.  I know I can use Google Reader, but there is something useful about having all of the blogs in a single list on a single page.

Monday, 4 April 2011

Button to open db on a particular server

We have many servers in our environment and we try to make sure users use their local server for their applications.  Below is a simple button to force a user to open an application on a particular server, which will place this replica on top of their replica stack.

Friday, 1 April 2011

XML - Part three - Import

This is the third XML article in this mini series.  Please take a look at Part One, which talks about the Script Library and Part Two, which talks about the export agent, if you have not already seen these.

The second agent I have written allows a user to import an XML file and replace all of the document fields with the values found in the XML document.

My code takes the first "Document" from the "Documents" tree and finds the <id> value, which is used as a key to find the document.  With the <id>, I can find the document and then run through all of the fields in the XML and replace the values within the document.  The field name is the same in the document as it is in the XML file, so no mapping is required in this example.

XML - Part Two - The Export

This is the second XML article in this mini series.  Once you have created the script library in your database (Part One), you can create the first of the two agents.

The agent below allows a user to export the selected documents as XML.  This creates an XML tree of "Documents", with each "Document" being a node.  This code fixes the file destination to "C:\Temp\Document.xml", so you will have to change this to fit your requirements.

I use a view to handle the field names to export, as I do not want to export every field.  My field configuration will be the subject of a further post.  For now, think of it as a list of field names where there is one document per field.

XML - Part One - The Script Library

I am going to write a three part post on how to handle the importing and exporting of XML files into Lotus Notes.

Recently, I had a requirement to export a number of documents to XML.  The file would then be read into a customers helpdesk, which was not Lotus Notes based.

I have exported to XML before and have kept a Script Library in my "black box" for this very purpose.  I did not write the script library, but I will share the code here.

Wednesday, 23 March 2011

Import Excel file

Here is some sample code to import a Microsoft Excel file, rather than a CSV file.  I was looking for some sample code to help release the task on the server.

Thursday, 10 March 2011

Split

Today, thanks to this blog, I have discovered a useful script function called "Split".  I am sure I have used it before, but it escaped my thoughts yesterday when coding the Excel export function.  I know and use Split with JavaScript, but did not remember that it existed in LotusScript. 

Thanks to a comment from Theo Heselmans, my code is now updated and working better than before.  This help and advice is what I love about the Lotus Community.  Thank you.

GetFormattedName function

A simple function I came across going through some old code.

This code accepts a string and turns it into a names field, from which you can send a parameter to get the different types of name, such as Common, Canonical and Abbreviated.

Export Field Revisions to Excel

At home today, due to being snowed in.  I like working from home as it keeps all the banter, telephone calls and meetings to a minimum and when I am coding I like peace and quiet.  I know the developers I work with listen to music, but I don't really like doing that. 

Today I wrote a nice piece of script to export document history to Excel.  The document contains around 14 fields that are stamped when a history snap shot is taken.  These could be dates, text, names and number (no rich text).  The history will be rarely viewed, but when they want to see it, they want to analyse it in Excel.... as always !  

Application to refresh databases

This is an article to discuss a new application that I am working on with some colleagues.  We are all developers and we all know the perils of releasing templates into Production and the pitfalls that can occur.

I am aware of the TeamStudio product called Build Manager, which is a great product, but not all companies are free to spend much money at the moment and so I was tasked to provide another solution.  I am sure there are other tools, and I would be glad to hear from you, if you know such as tool. 
Having brain stormed the idea, it seems as if this is a straight forward LotusScript agent, with some API.  

View to CSV

While writing the previous blog, I thought about another agent that I use quite often.  This agent allows the user to print out a selection of documents from any view, or if there are no selected document, it will output the entire view. 

It is a simple agent, which I just have set to "Run on selected documents".


Download the File.

Find missing databases

When server clusters have not been set up correctly, or you know that two server should have identical database replicas, we as developers often are asked to write a nice piece of Lotusscript to find all the databases on one server and then find the databases that are missing from another.