logo

Ask A Question Week

Following on from yesterday's little Q&A session and the surprising news that there's a newby among us I've decided to run a whole week long Q&A session.

If you've got a question you were always too scared to ask or never knew the right place to then the place is here and the now's the time. Just send me an email or reply to this thread. When I've built up enough I'll start a week of answers.

Questions can be about anything really. It could be specifically about Domino, something more general or even a question aimed at myself and the reasons why I do what I do. Don't worry if you think the question is too simple or too stupid. Heck, we've all spent time in the forums ;o)

Comments

  1. OK, here's a question.

    I sometimes get Notes to print badges. I have a layout region which directly matches the badge templates. It uses Computed for Display fields to display the name (Company or Office Location etc.)

    So here is the question. How do you get them to display aligned centrally rather than left justified?

    This question has been bugging me for 8 years now. I have to revert to an old 4.6 version of the database to copy/paste and rename the field elements. Apparently back on 4.6 you could set the alignment, but as of R5 that option was removed. Go figure.

    • avatar
    • Benoit
    • Wed 18 Apr 2007 06:00 AM

    In the designer, we can hide design elements from "Web Browser", "Notes R4.6 or later", and... "Mobile Client"

    What is this "Mobile Client" option ? (Does it mean Palm's or other mobile devices ?)

    How does Domino determine if the user is a Mobile Client ?

    Is it a lotus notes mobile client (lotus notes on my palm... wow) or a web mobile client ?

    This option may not be used frequently...

    • avatar
    • Ranjit
    • Wed 18 Apr 2007 09:10 AM

    In a custom-form built for a Blackberry, how do you enable attachments - hopefully, with a bix of Ajax thrown in akin to the Gmail client?

    • avatar
    • pr0gm4n
    • Wed 18 Apr 2007 09:41 AM

    Some time ago, I was adding functionality to the mail template. And I needed to capture the *documentDelete events, in the database script.

    BUT the template was multi linguel, including both English and Danish design elements. When I modified the database script visible under "Database Resources" the new code only exits in the English "version" of the database.

    How do you access the database scripts corresponding to the other language settings in a database/ template?

    • avatar
    • Doug
    • Wed 18 Apr 2007 11:11 AM

    Does the existence of $Conflict on a document mean that the doc is a rep/save conflict? If you open and save the doc will $Conflict go away?

  2. What is the sound of one hand clapping?

    :P

    • avatar
    • Greg
    • Wed 18 Apr 2007 03:58 PM

    Enquiring minds may want to know. If it is true that people that work at home, can and do wear underwear to work. What does Jake wear on casual Fridays?

  3. Jake, are only you allowed to answer questions?

    In hope that not... ;-)

    @Doug:

    Yes and Yes

    @pr0gm4n:

    Did you try to change the language settings of your Notes client (and restart it afterwards)? It could be the interface language or the content language...

    @Dragon Cotterill:

    Have you tried to use layers instead of layout regions?

    Finally I have just answered one comment and asked two more questions :-)

    Thomas

    • avatar
    • Michael
    • Wed 18 Apr 2007 07:38 PM

    Jake,

    Not looking to steal your thunder, but in the past five years or so, I've never seen mention of Global Designer in your blog, so I'm offering an answer to pr0gm4n as I frequently build multilingual dbs with that app.

    In my experience, the Database script never gets built beyond the source language with DGW unfortunately. I checked using NotesPeek to confirm that the translated script was not in the multilingual db, and it's not making it in after the build. The formula language workaround is for you to check the @LanguagePreference with an @If statement and put the code for both languages in the source.

    If you want a workaround that can leverage your glossary and you're using Lotuscript, put the code into a regular LS script library and call that function from the database script with the appropriate event parameters. Localise the called script library with DGW and after your next build, it will work as expected. As you may already know, you can edit a script library that has been translated, but you won't be able to save it within a multilingual db. Designer won't let you save the script library as it shares the same name with other language. The editing would be good for a multilingual build, but a it's not allowed in Designer. Hope that helps.

  4. Well, here goes a tough question (at least for me!):

    I'm developing a central dashboard. It gathers data from different sources (SQL servers, XML, Web pages, and Notes!).

    I'm writing notes agents to gather those data.

    The main problem is with web pages. I have several (more than five, of different domains/languages/structure) that needs authentication.

    So I have be able to write a script (lotus or Java) to open the URL, authenticate, get the HTML or image (in three cases, theres a dynamic PNG graphic), and save it into a Notes Document.

    I'm think on in two ways:

    1) Write a code to send a "POST" to the URL with the user & pwd;

    2) Write a code to setup a session cookie.

    I must admit, I'm a little bit lost on witch approach is the best (or a 3rd approach) to achieve the result.

    By the way, the hardest way, would be to not have to authenticate. It's almost impossible, since I'm gathering data from different companies...

    Any suggestions?

    • avatar
    • pr0gm4n
    • Thu 19 Apr 2007 12:29 PM

    @Thomas Bahn

    Yes I tried that. I even considered installing a Danish Designer, but I didnt try that out.

    @Michael

    DGW wasnt an option, as it was just a minor adding to the database script of the mail-template.

    So I solved the problem by introducing two mail-templates to my customer, one UK and one Danish.

    Thx for the responses, and it is not even answer week yet :-)

    • avatar
    • Niclas Sund
    • Thu 19 Apr 2007 12:50 PM

    Hello. Im am very interested in gathers data from an RSS feed or from any page actually and save the result in a view as unique documents.

    Is that possible?

  5. @Rafael & @Niclas

    Try a Domino Java agent and use/extend the Apache Commons HTTPClient to do the gathering of information from urls/websites/rss feed.

    I used it before to retrieve RSS feeds from a url including authenticating with the proxy server and then saving the XML in a notes document for users that weren't allowed internet access.

    • avatar
    • Rob
    • Thu 19 Apr 2007 11:59 PM

    BACKGROUND

    My databases send out lots of individual customized email messages from Java agents. I created a system which does a kind of mail merge between a template memo document and the target document(s). I write the boilerplate text in the memo template placing tags in the text like this: <<FirstName>> <<LastName>>. My Java library searches the template for these tags and substitutes the data in document items with the matching name. In the above example the data in the item "FirstName" is substituted for the text string <<FirstName>>, etc.

    QUESTION 1:

    The memo "Body" field which contains the template text is a rich text field. Since I have found no way to search and replace in a rich text field I first have to extract the text and do the substitution in a plain text variable and then stuff it back in. Do you know of any way to search and replace in a rich text field short of buying one of the (expensive) third-party libraries?

    QUESTION 2:

    Do your know how to send an attachment with an agent-generated email message?

    QUESTION 3:

    Do you know how to create an agent-generated email message which contains an HTML formatted body?

    QUESTION 4:

    It would be handy to be able to send agent-generated email messages with the "From" and "ReplyTo" fields set by the agent and not set to whomever signed the agent. Do you know the definitive answer to how to do this?

    (It's been a source of irritation to me and my customers for over eight years and I just don't know why IBM/Lotus make it so hard for me to create systems that do what I want them to do, not what they think I aught to want.)

    Thanks for the "answer week". It's just what I needed.

    Rob:-]

  6. response to rafael - dump Notes for this and switch to a JSF/ Jboss solution, it will do all you need and more !

    • avatar
    • Niclas Sund
    • Fri 20 Apr 2007 04:13 AM

    tony, could you be more specific or maybe upload me some sample of how I can do this. Or maybe Jake will digg in to thiswhen the answer week is here.

  7. @Niclas - I'll have a search through my files and see if I can find it. Check my blog over the next week and I'll post something there.

    @Rob - what version are you using ? version 7.0.2 could help with a couple of your questions.

    Q1 - I'm doing a similar thing but using XML with custom namespace tags and the SAX

    Parser in LotusScript.

    Q3 - 7.0.2 has MIME Support for sending HTML emails.

    Q4 - I just set the fields in script and it works fine (same too with the mime version)

    Set m_mimeHeader = m_mimeEntity.CreateHeader("ReplyTo")

    Call m_mimeHeader.SetHeaderVal(ReplyTo)

    • avatar
    • Baiju
    • Fri 20 Apr 2007 07:36 AM

    @Rob,

    Q1.

    If your rich text field has the option "Store Contents as HTML and MIME" you can use the NotesMIMEEntity class to loop through each of the mime part and get the HTML text using the Mime.ContentAsText method. Then you can replace the tags in the plain text and again set it back to the mime part using the mime.SetContentFromText method.

    Q2.

    If you are using NotesMIMEEntity to send HTML email, you can send attachments easily with the mail. You need to create a child entity to the MIME and set the proper header values and point to the path of the attachment. Open the attachment using a fileStream and attach the filestream to the mail using something like

    Call child.SetContentFromBytes(fileStream, "application/octet-stream", ENC_IDENTITY_BINARY)

    where child is the childEntity

    Q3.

    Above answer explains it. You need to use NotesMIMEEntity and NotesMIMEHeader class

    Q4.

    Set the "Principal" field to what ever name you want to appear in the "From" field.

    Hope this helps.

    • avatar
    • Stevo
    • Fri 20 Apr 2007 08:47 AM

    @Jake,

    My question is do you really need an Answers week?

    It looks like your work here is already done!!!

  8. "Zen and the Art of Collaboration"......the power of the community is working right here.

    Thanks to your sowing; we all get to do our own bit of reaping.

    (feeling very hippy-ish today)

    -Devin.

    • avatar
    • Partha
    • Fri 20 Apr 2007 10:13 AM

    @rob

    Check findandreplace method of Notesrichtextrange class, very useful function

    • avatar
    • Rob
    • Fri 20 Apr 2007 11:40 AM

    I should have mentioned that we're using version 6.5 (although I've heard rumors that we might upgrade to 7.x in the next few months).

    Wow, thanks everybody. I guess I haven't been keeping up with the features that have been added to Notes over the years. I'd either found a suitable (partial) work-around or have been telling my customers that I can't do that.

    @Baiju

    I went back and looked at our Java email class and found this comment about the "principal" field (this code hasn't been touched since 2001):

    /*

    LN's version of the From field is called "Principal", and it must contain a full

    Internet email address AND the Notes hierarchical path (aka Notes domain);

    the path can be either abbreviated or canonical (i.e. including keywords).

    ex: (abbrev.) person@icgcorp.com@ICG1/ICGCORP or

    (canon.) person@icgcorp.com@/OU=ICG1/O=ICGCORP.

    The slash immediately after the second "@" in the hierarchical path can be omitted.

    */

    It's been too long now to remember for sure but there was something about this that never worked the way we wanted it to. I think the problem was that messages sent this way would have a "From" address something like this:

    From: RFIC.PSS@dowork.com (apparently sent by Robert Shaver/SAC)

    Notes was still adding the name of the agent signer.

    @Partha

    Thanks. I missed the addition of RichTextRange in v. 6.5. I'm going to take a look at that.

    @Everybody Else

    Thanks for the responses. They've got me thinking outside the box I didn't even know I was in. Rob:-]

    • avatar
    • Ben Dubuc
    • Fri 20 Apr 2007 01:25 PM

    I often wanted to create a kind of data grid where you could sort documents only by drag and drop.

    Is that at all possible within the Notes client?

  9. @Tony: Thanks for your response. I'll be waiting for your post in your blog.

    Just to make sure: Did you manage to login with that solution?

    @Garry: Thanks, but I have an old addiction on Notes/Domino! ;-)

  10. Jake / All,

    I need to add the Windows network username to the Domino directory. I have JS and VB code that should work but I do not know the best way (place) in implement the code.

    So, my questions are;

    Has anyone done this already?

    How did you do it?

    Thanks,

    Steve

    • avatar
    • Richard C
    • Mon 23 Apr 2007 01:36 PM

    How do you control the widths of the buttons in Internet Explorer - without having to specify the exact width for each button?

    If you have a few words on the buttons, IE will put in a big amount of spaces on before & after the text. I simply want to trim that space down ... Other browsers seem to do it ok, but not IE ...

    • avatar
    • John J
    • Mon 23 Apr 2007 03:18 PM

    How do you go about dynamically (read: through code) building a Domino form? I regularly have a number of forms that will each contain a number of documents that will provide data to a dialog list through a dbcolumn that I need to create.

    I'm looking for a way to create a form 'on-the-fly' to speed up my time spent on this task...

    • avatar
    • Eric
    • Tue 24 Apr 2007 03:12 AM

    How to check if changes have been made in fields (when leaving a page) with Prototype?

    Regards,

    Eric

    • avatar
    • Johan
    • Tue 24 Apr 2007 04:32 PM

    Not having touched Notes or Domino in the past 3 years, i'm still reading your weblog. And thanks for bringing back that personal touch!

    Anyway, this question week is my last try:

    Where do i find an English online shop were i can order some GOOD malt vinigar????

    I just don't find this in Belgium :(((

    Thanks for the help!

  11. In my NotesTracker version 5.0 (released 4/4/2007) I added the sending of e-mail alerts when selected events occur (a certain field is updated, a doc is deleted, etc). I gave the option to send either immediate or scheduled alert e-mails, but could not find a way for "On error" to prevent the displaying of the "Addressee's address does not exist in the Address Book". It seems that even if the LotusScript "on error" will detect that a problem has occurred, the Notes Client still throes out the dialog box and the Domino Agent Manager still sends an error message to the console, which is the very thing I was trying to stop happening. Does anybody know if there's any way for "on error" to catch this mail send error and suppress the dialog box or console message?

    • avatar
    • Alastair Grant
    • Mon 7 May 2007 07:05 AM

    Thinking about building really large web sites and holding user login credentials in a secondary address book... could domino cope with say 1 million registered users? What about 7 million?

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Wed 18 Apr 2007

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content