This, that and the other (may contain nuts)

Dominoblog - inserting your own profile photo

Steve Castledine  22 June 2010 17:21:46 GMT
When you setup Dominoblog for the first time, you get a "generic" picture for the owner, like so:

'alt' title='' height='51' width='51' /> <br /
One of those "if I had a pound for each time I was asked I would be rich" questions is how to change this yourself.

Basically the image is 87px x 87px and is stored in the actual template design under images and "photo.gif" and the html rescales to 51 x 51. So if you want to change it you have several options.

First option, if you have designer access, is to just swap out that image. Secondly if you go to "Advanced > HTML templates > Block Templates > LeftSideBar", then the html can be edited to point to another image, and one that has been uploaded via the client and not designer (via Uploaded files).

So if you have uploaded a new file, edit the image html in "LeftSideBar" to (notice src is lowercase):


<img id='id_photo' class='left' src='blogphoto.jpg' alt='alt' title='' height='51' width='51' />


Image:Dominoblog - inserting your own profile photo
Image:Dominoblog - inserting your own profile photo
Image:Dominoblog - inserting your own profile photo

Image:Dominoblog - inserting your own profile photo

In addition to this, you can assign "author" photos which display in content depending on the author, more info here.

XPage Control: Multi Select Dialog Picker

Steve Castledine  16 March 2010 11:18:43 GMT
I have just released an XPages Multi Select Dialog Picker control on OpenNTF.

The multi-select dialog picker allows you to specify a Lotus Notes View/column based data source, or via an api any list you may choose and return a list of selected values. There is full documentation here. You can also bind to any field for automatic selection and updating of values.

I will write a follow up article on some of the client side coding techniques.

Image:XPage Control: Multi Select Dialog Picker
Further features:


1) The picker can easily be bound to an existing editable field or values returned via api.

2) Allows users to add new values, or via property disallow this function

3)Multiple use on one page.

4) Data can come from existing database, db on existing server, or db on another server

5) Background colors, list height and width, titles etc can be set via properties

6) Extends Dijit.dialog so can be hidden, shown etc using usual dojo api

7)Self contained – so just one custom control to drag and drop (no code or css files to copy as well).

8)Cross browser and XPages Client compatible

Dominoblog: Templates

Steve Castledine  11 March 2010 12:39:10 GMT
Denny had a question:

I want to have a 'Home' page that starts when the blog is opened, then I want to have a link that will take me to the Blog and I want to do all this with the .nsf file.

So I took and made a copy of the 'Home Page' found within the 'Page Templates'.  I then renamed the copy to "Blog" and saved it.

Next I changed the 'Home Page to look like what I wanted.

Now my question is this, How do I Call the new page I made from my top menu or is this not possible and I'm going about it all wrong?


Makes sense to answer this and provide some detail on the template structure at the same time.

Where are the Template and how do I set them

Templates are found within the "Advanced > HTML Templates" section of the application. Which ones are used are determined by the wizard "Site HTML Templates" which can be found under "Advanced > Configuration" menu button "Wizards > Site HTML Templates". These settings are also repeated in the main configuration document but the wizard makes it easier to access.

Image:Dominoblog: Templates Image:Dominoblog: Templates

Template Types
There are two types of templates "page" and "item". Page templates determine the layout for entire pages, whereas item templates determine html per row of displayed data which would be each of your blog posts.

There are also "block" templates but these are just used for repeating parts of html. So if you have a home page, a document, search etc there will be a common sidebar, header etc so we can use block templates for these to save us maintaining this in many places. They are inserted into the page templates using &lt;$DXTemplateBlock Name="block name"$&gt;.

When you create a new blog, then the default layout is created automatically using these page, block and item templates. Then the configuration is updated to point to these templates (there is an obviously located script library which does this, within the design).

A potential theme manager would store a collection of these templates, config settings, together with any css and images required as a "theme".

Basic theory
So from the top the blog or website could just be one page, the home page. You would have a "page" template with nothing but html, set the site/homepage template to be this and you would have a very basic "static" site.

Image:Dominoblog: Templates
There would be no functionality however, and any content you add would not appear here. So this is where the "tags" come in, they insert the data/functionality where you want it within your html. For the homepage you would simply add a tag &lt;$DXContent$&gt; and this will insert the latest blog posts.

As part of answering Denny's question, note that the homepage template is the only one (aside from maybe the archive template) where you can put html in and it can be called directly. Although it doesn't have it own "link" it just knows that if the base ".nsf" is called in the url then the homepage should be displayed. Otherwise templates are just for defining layout and are not accessible directly.

So onto the next part, you may have told the application (via the page template) to display the latest posts on the homepage via the tag, however you have not told it how to display them so nothing will happen. This is where the item templates come in, you create one of these with the html you want per row, add the data you wish to display (again using tags - see the link to the tags at the end and also the default templates) and set in the template wizard under "Site Item Template".

Image:Dominoblog: Templates
For a basic site, the final thing you would do is create a new page template for the "full page posts" themselves by copying the html you used for home and creating a new template and setting it to be used from the template wizard. You would remove the &lt;$DXContent$&gt; tag and replace with the html you would have used for an item template (as its only 1 document not many).

The same theory works for the archive, search etc pages. I will write a follow up on the comments system.

Launching specific Templates
I've titled this part to answer Denny's question really, as I have already said you cannot directly launch a template as they are just "layout instructions". So if you want to create something that you can launch, you would create your page template and then either create a new post, or a static page via "Resources > Web Pages" and link the template to it.

Image:Dominoblog: Templates
To tell the application to use the template for this page, you select "Show HTML Options" from within the page or document, then select the "document template" to use.

Image:Dominoblog: TemplatesImage:Dominoblog: Templates

When you access the document or page via its permanent url then this template/layout will launch. Incidentally, the url can be set manually via "Show Advanced" and "Page Name" . Obviously you can also use the content and data within the page/post if you wish by inserting the usual tags into the template.

Image:Dominoblog: TemplatesImage:Dominoblog: Templates
So as you can see you could use this feature to create a specific look for any of your blog posts or static web pages. It works as a "waterfall" system, with the master template settings in the wizard/configuration, a second level of settings in the category documents (if you use them) and a final override directly in the pages themselves.

Some Links:
Wiki Article on themes and tags
Converting a theme from Wordpress part 1 and part 2

Questions?

    Spotted on Google Street View

    Steve Castledine  11 March 2010 11:36:34 GMT
    Leicester finally has Google Street View from today (must be nearly 2 years since they took the images). I remember the Google car passing me whilst out with Millie, who must have been 3 months old at the time and sure enough:

    Image:Spotted on Google Street View

    Image:Spotted on Google Street View

    Dominoblog - give me the dirt

    Steve Castledine  26 February 2010 10:04:46 GMT
    Image:Dominoblog - give me the dirtThe subject is slightly tongue in cheek, but the question is a serious one.

    I've read on more than one occasion this week the line "difficult to use" for DominoBlog. So I need to find out what is the part that is difficult to use. From a user standpoint creating a blog entry should be no more difficult than creating a new email. Creating a new blog is no more difficult than "File > Application > New" (not that I like that, but its the same for all Domino applications).

    So I can only assume its not that process that is a problem, but if it is let me know. I guess the tricky side is the flexibility of creating a Domino web site exactly how you want it without using Designer. However, like any software that creates a web site, you cannot avoid html. Maybe there are specific things you want to do but want them automatic? Maybe its just documentation on some keys things, if so what?

    So this is an open discussion, tell me your pain points, tell me what you need, your ideas on making it easier, anything.

    OpenNTF gives us a unique opportunity in that I can get you some of this directly without waiting for a build cycle, funding and someone to translate into x number of languages. I will put aside some vacation day/s to get some of these things improved or maybe just documented. With some of the bigger things then why not volunteer and we can build as a community team.

    I do understand there is a "enterprise" gap which Lotus Connections mostly fills, but you need it slightly better for DominoBlog. I personally do not like "File > Application > New" as in the enterprise those pesky admin's have mostly made this redundant for browser based apps as they don't want you creating applications here, there and everywhere. I did design a "template deployment app" where an admin can set controls and sleep at night knowing users are doing things to their rules, however so far it has remained on the beer mat it was written on (next to my housework rota). This needs kicking off (community project anyone?).

    So the floor is open, however in the meantime some helpful links:

    There is user help in Lotus Notes under Help > Help Contents > Lotus Notes > Web logs

    Image:Dominoblog - give me the dirt

    Download Blog Template from OpenNTF
    Full list of blog related articles on this site
    Wiki Article on themes and tags
    Converting a theme from Wordpress part 1 and part 2
    Switching on anti spam (100% effective against non manual spam)
    Dominoblog 8.01 upgrade presentation
    Intranet Journal - Setting up DominoBlog
    Podcasting with Dominoblog

    Will add more as I remember them

    Just a teaser of some new XPages samples

    Steve Castledine  25 February 2010 11:07:45 GMT
    There's some XPages code that I have been trying to finish so I can upload to OpenNTF - so here's just a teaser (as I think there will be some good reusable parts):

    Image:Just a teaser of some new XPages samples

    Image:Just a teaser of some new XPages samples

    XPages: Validating Radio Groups Client Side

    Steve Castledine  17 February 2010 09:45:48 GMT
    This has come up twice recently so thought I would share a few tips.

    Server side validation of radio groups and also check box groups on a basic level is very simple. You navigate to the component properties and add a "required" (xp:validateRequired) validation rule via data > validators.

    I say simple however other components do have this available on a specific validation tab whereas these you have to drill down to the properties:

    Image:XPages: Validating Radio Groups Client Side
    If you want to do more advanced validation then the value is available via getComponent("radiogroup").getValue(). Depending on where on the page you are trying to validate the value (maybe before the component) you may need to use getSubmittedValue() instead but mostly getValue() is what you would use.

    Client side is a little trickier, as just like any web application and javascript accessing of radio group values its not available as a single value but as independent values of the radio group (or check box) child values.

    To make it harder you have to get values via the "form" element and even harder I find JSF style name's are not liked in browsers for looking up named elements of a form (at least it was a struggle for me) so you have to traverse the entire form to get the element you need and then get the value you want.

    The code below is an example of what I mean. First it goes through all the form elements to find what we need, then it iterates through the child elements to find the value. Note how it uses #{id:myRadioGroupID} to calculate the eventual component name (which may actually be: view:_id1:myRadioGroupID).

    var result=null;

    for(var i=0; i<document.forms[0].elements.length; i++){

    if(document.forms[0].elements[i].name=="#{id:myRadioGroupID}" ){

    if(document.forms[0].elements[i].checked == true){
            result=document.forms[0].elements[i].value;
            break; //remove this if for check box groups and collect multiple values above instead
    }}}

    alert(result);

    XPages: Hide Detail Rows

    Steve Castledine  16 February 2010 14:41:42 GMT
    Very quiet around here as very busy (some very cool stuff) and still catching up on "I will document that for you" from Lotusphere. So here's one off that list "Hide Detail Rows".

    So in Notes development we have the ability to add numeric values to columns and add totals. Often we are not interested in the number per row but just the totals, maybe by category:

    Image:XPages: Hide Detail Rows
    So we set the view column property "Hide Detail Rows" to achieve this:

    Image:XPages: Hide Detail Rows
    When we want to do the same for XPages, this particular property is not carried forward and so when creating a default view we get:

    Image:XPages: Hide Detail Rows
    So the first thing we need to do for this example is to make it a whole number. To do this we navigate to the column properties and section "data" and set display type to Number, and format as Decimal, Integer only.

    Image:XPages: Hide Detail Rows
    We then need to hide the detail rows, but before that we need to assign a "name" to our row data so we can reference it. We do this in the view panel properties under data and "var" (set to "rowData" below).

    Image:XPages: Hide Detail Rows
    We then change our totals column to display a computed value. Our computed value would then detect whether we are a category or document row (using isCategory()) and display a value accordingly:

    Image:XPages: Hide Detail Rows
    Image:XPages: Hide Detail Rows

    if(rowData.isCategory()){return rowData.getColumnValue("$2")}


    Image:XPages: Hide Detail Rows

    Lotusphere 2010 warm up videos

    Steve Castledine  14 January 2010 15:57:15 GMT
    Found these warm up videos for Lotusphere 2010, getting excited yet?:




    and of course:


    XPages Discussion Template - new build available on OpenNTF

    Steve Castledine  13 January 2010 16:31:41 GMT
    I have uploaded a new build of the XPages Discussion forum to OpenNTF. You can download from here.

    This update enhances the existing XPage interface allowing more topics to be visible within the views and enhanced discussion thread viewing.

    Enjoy :)

    Image:XPages Discussion Template - new build available on OpenNTF
    Image:XPages Discussion Template - new build available on OpenNTF

      Millies first snowman

      Steve Castledine  6 January 2010 13:34:55 GMT
      We finally have a winter this year. The rest of the country has had a fair bit of snow, but we have had about 2cm max.

      But we still have a snowman:

      Image:Millies first snowman

      Image:Millies first snowman

      For those building Lotusphere Schedule applications

      Steve Castledine  6 January 2010 13:27:50 GMT
      Can I ask you to add this session to your databases (thank you):

      Meeting Name: OpenNTF Annual General Meeting
      Date of Meeting/Function: Tuesday, 1/19 – 6pm – 7pm
      Hotel: Yacht and Beach Conference Center
      Room/Function Area Name: Cape Cod C