Showing posts with label Lotus. Show all posts
Showing posts with label Lotus. Show all posts

Monday, December 08, 2008

I'm free...

It's been a long time since I've posted, since I've been so busy at work. I really hate the reason I now have time for the blog again...

So, apparently the publishing industry is not doing well. There have been major cuts at several publishers in the past two weeks, including my own. (If you're interested in which company I worked for, check GalleyCat's home page - there are currently four separate posts about it.)

I must admit it was kind of a shock. I knew there were layoffs coming, as a "corporate streamlining" team was hired to analyze the business after our merger earlier this year. But seeing as I was a major part of the technical integration team, it was kind of surprising.

I'm a little worried. I have 10 years experience in the field, but the last 8 of them have been pretty much restricted to Notes/Domino, and I'm really not sure what the demand is for those skills in the Chicago area. I'm a quick learner and have no doubt I could pick up any system or language a potential employer might want, but probably not before I need to start interviewing.

So, if anyone knows of open positions in the Chicago metro area (or telecommute positions with minimal travel anywhere), keep me in mind. I'll try to start posting more now that I have some time on my hands, starting with an early SnTT post later today or tomorrow.

Friday, July 20, 2007

Notes packet sniffer

Quite some time ago I remember someone posting a link to a utility that would place a small window near the bottom of your screen and show you exactly what is going on behind the scenes when the lightning bolt is flashing. Does this ring a bell with anyone? Any idea where I can find it?

Wednesday, October 04, 2006

How to shoot yourself in the foot...

Today's Digg feed produced this gem, along the same lines as this one.

So how would you shoot yourself in the foot in Notes? @SetFoot("Shot"), maybe?

Friday, June 23, 2006

Show-n-Tell Thursday - Color Palette Utilities

This isn't really a Notes/Domino tip, although my applications have certainly benefitted. For those of you (like me) who are color-challenged, coming up with a color scheme for a new app is difficult. How many times can you do shades of gray? But you don't want the yellow, purple, and red nightmare that every company has one of, right? That's where this little site comes in handy. You can enter a starting hex value or choose from a color wheel, and it generates a nice coordinated palette for you. You can then create variations on the palette, like pastel, contrast, etc. There's even a dropdown that lets you view the palette as it appears to various types of color-blindness. It then provides you with the hex values of all the colors in the palette.

Which you can then take over here to convert to Notes-friendly RGB values.

Show-n-Tell+Thursday
show+'n+tell+thursday
sntt

Friday, May 26, 2006

Show-n-Tell Thursday - Updating FolderReferences

We recently enabled FolderReferences on a database that already contained a lot of documents. According to everything I've read, you can only get FolderReferences for documents added to a folder after the property is enabled, but we needed to get it set for all the existing documents as well. I found a pretty simple way to do it. Just add an action to your folder template and refresh the design of all folders (or add the action to each folder) and run on selected documents.

Here's the code:

Sub Click(Source As Button)
On Error Goto errhand
Dim w as new notesuiworkspace
Dim s As New notessession
Dim db As notesdatabase
Dim v As notesview
Dim uiv as notesuiview
Dim doc As notesdocument
Dim dc As notesdocumentcollection

Set db = s.currentdatabase
Set dc = db.unprocesseddocuments
Set uiv = uiw.currentview
Set v = uiv.view

Set doc = dc.getfirstdocument
While Not doc Is Nothing
Call doc.RemoveFromFolder(v.Name)
Call doc.PutInFolder(v.Name, False)
nextDoc:
Set doc = dc.getnextdocument(doc)
Wend

Call uiv.deselectall
Call w.ViewRefresh

Exit Sub
errhand:
Print "Error at line " & Erl & ": " & Error & " for UNID " & doc.universalid
Resume nextDoc
End Sub


This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


Show-n-tell thursday
Show-n-Tell Thursday

Thursday, May 04, 2006

Show-n-Tell Thursday - Sending links to a view; open in a frameset

One of the things we do pretty frequently is allow users to send notifications with links to views/folders from various applications. This is usually to let someone know that data has changed in the folder, or that a flag has been set on the folder configuration document to indicate a change of status for the group of documents contained in the folder. The problem is, if you send a doclink to a view, it opens with the default navigator, rather than in the frameset that you've designed to contain navigation. I've gotten around this by making use of Julian's excellent DXL button creator class.

First, copy the code into a script library (or use as is in .lss format). In the Globals of each view/folder, include the script library, and add this sub:


Sub CreateButton(db As notesdatabase, thisv As notesview, mailDoc As notesdocument,
body As notesrichtextitem, label as string, frameName as string)
On Error Goto errhand
Dim button2 As New RichTextButton
Dim result As String
Dim openDatabaseString As String
Dim openViewString As String
Dim stringToPass As String
Dim frameToPass As String
Dim filepath As String
Dim viewName As String

filepath = Cstr(Replace(db.filepath, "\", "\\"))
viewname = Cstr(Replace(thisV.Name, "\", "\\"))

openDatabaseString = |@Command( [FileOpenDatabase]; "| + db.server + | ":"| + filepath + | ");|
openViewString = |@Command([OpenView]; "| + viewName + |");|
frameToPass = |@SetTargetFrame("| + frameName + |");|
stringToPass = openDatabaseString & Chr(13) & Chr(10) & "@UpdateFormulaContext;" & _
Chr(13) & Chr(10) & frameToPass & Chr(13) & Chr(10) & openViewString

'** append a Formula button to the body
Call button2.SetLabel(label)
Call button2.SetEdgeType(RTB_SQUARE)
Call button2.SetButtonLanguage(RTB_FORMULA)
Call button2.SetCode( stringToPass )
Call body.AddNewline(1)
result = button2.AppendButton(body)
If (result <> "") Then
Call body.AppendText("There was an error creating the button. " & result)
End If

Call maildoc.Save(True, True)
Exit Sub
errhand:
Msgbox "CreateButton error at line " & Erl & ": " & Error
Exit Sub
End Sub


This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


Here's what our action bar button looks like:


Sub Click(Source As Button)
On Error Goto errhand
Dim s As New notessession
Dim w As New notesuiworkspace
Dim db As notesdatabase
Dim thisV As notesview
Dim mailDoc As notesdocument
Dim body As notesrichtextitem

Set db = w.currentdatabase.database
Set thisV = w.currentview.view
Set mailDoc = db.createdocument

mailDoc.Form = "Memo"
mailDoc.Subject = thisV.Name & " is ready for your review."
mailDoc.SendTo = "Esther Strom"

Set body = New notesrichtextitem(mailDoc, "Body")
Call body.appendtext(s.commonusername & " has indicated that the " & thisV.Name & _
" catalog is ready for MarComm review. " )
Call body.addnewline(2)

'create button here
Call CreateButton(db, thisv, mailDoc, body, "Open Bid Folder", "contentFrame")

Call mailDoc.Send(False)
Call maildoc.RemovePermanently(True)
Msgbox "MarComm has been notified"

Exit Sub
errhand:
Msgbox "Info Ready for MarComm error at line " & Erl & ": " & Error
Exit Sub
End Sub


This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


The recipient then receives a nicely-formatted email (if you bother to do any formatting) containing a button that will open the folder in the context of the frameset as intended.



Show-n-tell thursday
Show-n-tell Thursday

Thursday, April 20, 2006

Show-n-Tell Thursday - Preferred views

Silly little technique that I use a lot, since we have many databases with lots of views. To allow users to set their own default view, create a shared action and add it to all views:
tmpText:="Do you want to set this as your default view?";

x:=@Prompt([YesNo]; "Set view"; tmpText);

@If(x=1; @Environment("newArtTrackDefaultView"; @Subset(@ViewTitle;-1)); @Return(""))


Then set your frame content to Computed and enter the following formula:
y:=@Environment("newArtTrackDefaultView");

@If(y="";"vwUsages";y)


Show-n-tell thursday
Show-n-tell Thursday

Thursday, April 06, 2006

Show-n-Tell Thursday - updating folder design

Folders can be a really useful design element. The only problem is that if you allow users to create shared folders in a production database, they don't inherit design changes from the template's default folder. Here's a fairly simple way to selectively update the design of those folders, or even allow an end user to update the design (after a developer has made changes and refreshed the design of the default folder from the template.)

Create a form that contains two visible dialog list fields, folderChoices and templateFolder. Also create a hidden field called folderList and a SaveOptions field set to "0". The default value of folderList should be @Unique(folderList). folderChoices should be set up to use formula for choices, and the formula should just be the field name folderList. The default value of templateFolder could go two ways: if you have only one folder template, make the field a text field instead, and set the default value to the name of the template folder. If, as we do, you have more than one folder design that can be used as a template, leave the field as a dialog list using formula for choices, and set the default value to folderList : "(Default Folder)" where the appended value is the name of your default folder (hidden in our case.)

Add this code to your PostOpen event:


Sub Postopen(Source As Notesuidocument)
Dim s As New notessession
Dim db As notesdatabase
Dim fList As NotesItem
Dim doc As notesdocument

Set db = s.CurrentDatabase
Set doc = Source.Document
Set fList = doc.GetFirstItem("folderList")
Forall v In db.Views
If v.isfolder And v.name <> "Default Folder" And v.name <> "(Default Folder)" And Not fList.Contains(v.name) Then
Call fList.AppendToTextList(v.name)
End If
End Forall
End Sub


Create a button and put this code behind it:


Sub Click(Source As Button)
On Error Goto errhand

Dim w As New notesuiworkspace
Dim db As NotesDatabase
Dim folderTemplate As String
Dim doc As notesdocument
Dim fName As String

Set db = w.currentdatabase.database
Set doc = w.currentdocument.document
folderTemplate = doc.templateFolder(0)

Forall x In doc.folderChoices
fName = Replace(x, "\" , "\\") Evaluate(|@UpdateViewDesign("|& fName & |";"| & folderTemplate & |")|)
End Forall
Msgbox "Update complete"
Exit Sub
errhand:
Msgbox "error at line " & Erl & ": " & Error
Exit Sub
End Sub


Add a button or outline entry in your database navigation that creates a new document using this form. The user can then choose which folders to update, and which folder to use as the design template.

LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


Show-n-Tell Thursday

Thursday, March 16, 2006

Domino hosting

I'm involved with Basset rescue. Here's why. I'm looking at putting together a simple web app that would allow people in the community to enter fundraising information. That's easy enough to do. How do I host it, though? I have a Domino server at home, and a broadband connection - is it possible to host it myself? What do I need to do to make my server accessible to the world? And do I want to?

If not, can anyone recommend a very low-cost hosting company? I don't need dedicated hosting; I just want to be able to attach a domain name to the site and be able to maintain the database. I've done the obligatory Google search and come up with a lot of companies, but would like to hear good things about a company from someone who's worked with them, since this is a non-commercial endeavor and I don't really have any kind of budget.

Show-n-tell Thursday: highlighting web view rows on mouseover

This tip is actually a solution I posted on Notes.net... er, LDD, uh - developerWorks Forums... whatever. Someone was looking for a way to highlight rows in a web view as the user was mousing over them. Although I started out as a web developer, I've spent the past 5 years working primarily on client apps, so I occasionally try to answer questions like that just to refresh my memory.

Create your view and set it to treat contents as HTML. Don't bother trying to concatenate all of your content into a single column; just create individual columns, each using td tags around the content.

The first column of the view should just be this:

"<tr onMouseOver=\"TrowOn(this,'#ffffcc');\"
onMouseOut=\"TrowOff(this,'#DFDFDF');\">"

Then create all your columns, creating links inside td tags. Your final column is just a closing tr tag.

Then, in the JS Header of your viewtemplatedefault, add these functions:

function TrowOn(src,OnColor){
src.bgColor = OnColor;
}

function TrowOff(src,OffColor){
src.bgColor = OffColor;
}

This will handle the mouseover row color changes. Obviously you can adjust the hex values passed into the function in the view tr tags to get the colors you want.
Show-n-tell Thursday

Thursday, March 09, 2006

Show-n-Tell Thursday - viewing SnTT posts

I've only recently started using Technorati, so maybe everyone else already knows this, but... if you set up a watch list in Technorati for Show-n-tell Thursday, you can view the list as RSS. In other words, no need to search for Show-n-tell Thursday posts at multiple blogs, or even go to Technorati to look them up. They'll be delivered right to your RSS reader.

Show-n-tell Thursday

Show-n-tell Thursday - date entry formatting on the web

Just a quick way to validate date formatting on the web using regular expressions...

function checkDates() {
missinginfo = "";
re = /^([0-9]{1,2}\/){2}[0-9]{4}$/
if (re.test(document.ReportDates.strStartDate.value)){
}
else{
missinginfo += "\n - Start Date";
}
if (re.test(document.ReportDates.strEndDate.value)){
}
else{
missinginfo += "\n - End Date";
}
if (missinginfo != "") {
missinginfo ="______________________________________________________\n" +
"Please edit the following fields to use the xx/xx/xxxx date format:\n" +
missinginfo + "\n______________________________________________________";
alert(missinginfo);
return false;
}
else return true;
}

Show-n-tell Thursday

Thursday, February 23, 2006

Is it Thursday again already? Show-n-tell

Just a quick little tip today. We have a lot of forms that contain dialog lists whose choices can be set in a profile document by an "administrative user." Occasionally they want to allow regular users to be able to add values to those fields, but for various reasons we don't want to give regular users unrestricted access to the profile document. Here's how we do it:

1. The dialog list field should be set to allow values not in list.
2. Create a hidden field on the form that uses the same @GetProfileField formula as the dialog list.
3. On querysave, test value of dialog against values in hidden field with this code:


FIELD fileType:=fileType;
FIELD fileTypeOld:=fileTypeOld;

@If(@IsNotMember(fileType; fileTypeOld); @SetProfileField("choicesForm"; "fileTypeChoices"; fileTypeOld : fileType); @Return("") )


Show-n-tell+thursday

Thursday, February 16, 2006

Code to format formula language

After the last post, I'm thinking my next side project is extending Julian and Joe's code to allow formatting of formula, as well as LotusScript...

Show-n-Tell Thursday


Taking up the call to arms, here's my tip. Not as impressive as many, and quite a hack to boot, but it solved a problem we had.

Issue: our field users' mail files were getting huge, and needed to be compacted on a regular basis. But many of them didn't even realize they had a server replica; all their work is done locally, with replication settings that are just a magic button to them. Asking them to open their server replica to compact it would cause major panic. I don't know why there wasn't a server task in place to handle this; I'm not an admin. In any case, there's a lovely Compact method available in the NotesDatabase class, but it only works on local replicas. So how do we get these users to manually compact a server-based replica they're not even aware of?

Solution:

1. Put an action button in my Inbox (or any other view/folder) with this code:

server := @Name([CN]; @Subset(@DbName; 1));
serverFile:="mail\\" + @Subset(@DbName; -1);

@If(
server!=""; @Command([FileDatabaseCompact]);
@Do(
@Environment("CompactNow"; "true");
@Command([FileOpenDatabase]; "yourServer" : serverFile ; "($Inbox)"; "" ; "1" ; "1" )
)
)

This first tests to see if the database is local or server; if it's server it does the compact; if it's local it sets an environment variable and opens the server database. Again, I'd need to add a few lines of code to determine the correct mail server for each user (just a dblookup to their local names.nsf to get their location document, I think.)


2. In the Database Script PostOpen event, I put the following code:

x:=@Environment("CompactNow");
server:=@Subset(@DbName; 1);

@If(server!="";

@If(x="true";
@Do(@Command([FileDatabaseCompact]);
@Command([FileCloseWindow]));
""
);
"")

Every time the mail database opens, it tests to see if it's server or local. If it's local it does nothing. If it's server, it checks to see if the environment variable that was set by the button is equal to "true". If it is, it runs the compact and immediately closes the database. If it's not "true", it does nothing (just leaves the database open for people who normally work in-office with server replicas.)


3. In the Database Script QueryClose event, I put the following code:

@Environment("CompactNow"; "")

This ensures that the variable is cleared out when the script from PostOpen closes the database so that the next time the user opens it, it doesn't automatically compact.

At least in my tests, all of this happens so quickly that you don't actually see the server replica open at all. It will take a few minutes for the Percent Used number on the server replica to adjust, but this is the case even when you run compact manually using the Compact button on the database properties box.


Show-n-tell Thursday

Tuesday, January 10, 2006

Notes calendaring

Am I the only one frustrated by the lack of documentation accompanying the alternate time zone feature on R6? I need to programmatically create a calendar entry. I've created one, and according to my document viewer, it's identical to a calendar entry I created manually, and yet it doesn't display the alternate and local time zones - it just treats the times I've chosen as local, period.

Tuesday, October 11, 2005

developerWorks RSS feeds

Just got an email letting me know that I can now add RSS feeds direct from developerWorks to my website... they have a click-thru wizard to make it easy.

Tuesday, August 23, 2005

SetAnyDate


I love it when I find out about a previously-unknown function... a great many have come to my attention courtesy of Stan. Just found another one, that happens to be very timely (no pun intended.) This is something I can use right now to fix a problem I've been having with training registration databases that generate calendar entries.

SetAnyDate


Does anyone out there have a favorite function, property, etc. that isn't well-known but is extremely useful in certain situations?

Tuesday, June 07, 2005

Using tables

Jake over at Codestore (new window) has admitted to using tables for form layout. My techniques have finally been validated! I love tables, and use them all the time. CSS is great in its place, but nothing can beat a table for a clean form layout that scales with the window size.

A few comments to that post mention that Notes tables are easier to deal with, and this may be true, but admittedly they create horrible code. So it's time to start taking advantage of R6 features. Create your table using the Notes properties box, then select it and choose Edit-->Convert to HTML. You can then choose View-->HTML Pane. From there you can tweak the code as much as you want, and see the results in the HTML Pane immediately. Very convenient.

Tuesday, May 24, 2005

Another potentially good feature gone to the dogs...

So I've been slowly integrating new R6 functions and features into my applications, now that 95% of my users are on 6. I just found @SetViewInfo and thought, "Wow! This could really be the answer to a lot of problems. No more reason to maintain 50 views just so users can see only their state." Think of all the ways I could use this!

But alas. It turns out that @SetViewInfo is not my own personal 42. It applies itself to every view, not just the current view. Not good. Ah, Lotus... why hast thou forsaken us?