วันศุกร์ที่ 27 พฤศจิกายน พ.ศ. 2552

Lotus notes : Modify a rich text field in the UI without having to save and re-open




One big issue with rich text fields is that "Modifications made to rich text items on the back-end document do not appear on the current document until it is closed and reopened." This means that any code you might have in the UI accessing a rich text field (create tables, append doc links, etc.) won't immediately show up without saving and re-opening.

Until now, either you saved and re-opened the back-end doc to reflect the changes to the rich text field (which meant that you also had to incorporate some sort of clean-up code if a user chose to cancel the save) or you don't reflect the changes in the UI, which can cause some user confusion ("yes, you did make the changes but you have to save and re-open the doc to see them").

With the following code, you can modify any rich text fields and reflect those changes in the UI without being forced to save the document. In this example, I am appending a document link but I have tested the code for creating a table as well. The user may notice a slight flicker as the document is closed and re-opened.

One other application for this code is Computed Subforms. In the Designer Help, it is stated that "Subform formulas cannot be refreshed while the document is open." This method of re-initializing the document in memory allows the Computed

Creating an IBM Lotus Web Content Management site structure with one click




Introduction

If you work with IBM Lotus Web Content Management, one of your recurring tasks is defining site structure. This task by its nature is time-consuming and repetitive; you are required to take more than 10 distinct steps to create a single site or site area. Moreover, site structures are not portable by design; you cannot export your site structure from one library on one server to a different library on a different server. Instead, you need to recreate the entire site structure manually.

Because the number of sites and site areas that make up a single site structure can reach the thousands, you need a method to automate the process of defining the site structure and to make it easier to move, export, and import. In this article, you can learn a simple way to define your site structure as an XML file and deploy it accordingly.

Back to top

Prerequisites

You should be familiar with these technologies:

* IBM WebSphere® Portal V6.0 and later, its administration, and its components
* IBM Lotus Web Content Management
* XML

To demonstrate how you can create a site structure in Lotus Web Content Management without manually creating all the sites and site areas, this article uses Lotus Web Content Management APIs and an XML file that contains the site structure. You can create the XML file containing the structure by validating it against the XML schema provided in the Downloads section of this article. The XML schema validates the structure and mandatory fields to prevent runtime errors.

You can define many sites, site areas, and default contents to create the site structure in the XML document that contains the complete site structure. First, create these prerequisites:

* Lotus Web Content Management library
* Authoring templates to be used in the site structure
* Presentation templates to be used in the site structure
* Users to be used in the security settings section
* Workflows, workflow actions, and workflow stages to be used in the authoring templates

You then define the site structure in the form of an XML file, specifying the library, sites, site areas, and so on. To ensure that the provided information is sufficient to create a site in Lotus Web Content Management , the XML file is based on the schema defined in the XSD file provided in the Downloads section of this article. The XSD file contains all the validations required to create a complete site structure, with default contents containing some fields.

You then create a JSP component to parse the XML file and create the site areas defined in it.

Back to top

Implementation

In this section, we describe the steps that you take to implement the solution. We start by discussing the creation of the XML file and the XSD file, and then we move on to the JSP component that parses this file.

XML creation

The XML file contains all the information needed to create the site structure. It contains the library name, the site structure, the site area structure, and the default contents. An XML file needs to be defined in a structure that corresponds to your requirements. See the XML example in listing 1, which corresponds to the site structure shown in figure 1.

Figure 1. Site structure
Site structure

The site is made up of a single site area; that single site area, in turn, is made up of another site area.

Listing 1. XML example used in the creation of the site structure


Figure 2 shows a sample mapping between the XML elements and the output created after you implement the solution.

Figure 2. Mapping between the XML and Lotus Web Content Management objects and sections
Mapping between the XML and Lotus Web Content Management objects and sections

As you can see, the mapping from the actual site structure to the XML file is straightforward with a root element representing the library. This root element then contains another element that corresponds to the site, defining its name and display name. Site areas are defined in a nesting fashion in the XML file to obtain the required site structure.

Every site and site area contains a settings section that holds the security settings and template mapping sections. The following are restrictions that need to considered: Security settings and template mapping can be created for each site or site area in its respective element or in the highest site or site area in the tree, with its child elements inheriting them.

Content security settings and workflows are added in the authoring template component, not in the default content section in the XML file.

Authoring templates and presentation templates used in the template mapping and in the creation of the default content have to be created previously.

Default content can be reused in multiple site areas by defining its name. After you define a complete default content element in the XML file, you can then use it by defining a default content tag with only the name element. This feature of reusing the default content in different and multiple places can also be used if the default content already exists for that library.

What’s new in IBM Lotus Notes and Lotus Domino 8 software. : Upgrade the way you work

Business moves quickly, so you need to help your employees excel
In today’s fast-moving business world, it’s more important than ever for employ-
ees to be productive, innovative and flexible. The challenge for IT managers is to find solutions that people can use—and will use—to unlock the potential for increased employee productivity and business growth.
What does IT need to meet today’s demands? A solution that:
Provides communications and col•
laboration capabilities that work the way users work.
Helps save time and reduces costly • mistakes.
Minimizes training time and applica•
tion downtime.
Meets needs now and has potential • for the future.
For years, IT managers have turned to the IBM Lotus Notes® and Lotus® Domino® portfolio of software solutions to help meet
their workplace challenges. Lotus software
has long given IT professionals the power to enhance the way they work. But what about the end users? They want the ability to collaborate and share the kind of ideas that help grow the business. The opportu-nity to act on ideas and make informed decisions. And the power to do their jobs better, every day. IBM Lotus Notes and Lotus Domino 8 software is designed to provide these benefits.
Upgrade more than just your software; upgrade the way your users work
The new release of Lotus Notes and Domino software provides users with much more than advanced messaging
and collaboration tools. Users gain access to business applications, productivity tools, the latest Web 2.0 innovations and more—without needing
to leave the Lotus Notes client. New capabilities let users customize their desktops and surround themselves
with widgets that help bring intelligence from the Internet directly to them. With enhanced support for a number of different mobile devices and slow connections,1 users can access their Lotus Domino e-mail, calendar and contact information—from virtually anywhere and at any time.2 Administrators
have advanced tools to help them minimize help desk visits and reduce the time spent training end users. And because Lotus Notes 8 software is built on the open-standards-based Eclipse3 platform, application developers can easily add Eclipse-based plug-ins and creatively build new applications to help extend and customize user environments

SharePoint Integrator for Lotus Notes v2.0.2





A minor update to Mainsoft SharePoint Integrator for Lotus Notes has been released. SharePoint Integrator v2.0.2 introduces support for the latest Lotus Notes clients: v7.0.4 and v8.5.1. SharePoint Integrator was tested on Windows 7,

How do you edit a rich text field in an open document and redisplay it in Lotus notes?

In Lotus notes we have some problem when I create richtext field that have picture by backend. This sample code for solve it.

Dim wksp As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument, uidocNew As NotesUIDocument
Dim doc As NotesDocument
Dim rti As NotesRichTextItem
Dim strFieldname As String

Set uidoc = wksp.CurrentDocument
uidoc.Refresh True ' do this if the rich text field is editable, to get the current contents in case user has modified them.
Set doc = uidoc.Document �' get the back-end document for the document open on screen.
strFieldname = uidoc.CurrentField ' remember the current field if any
Set rti = doc.GetFirstItem("fieldname") ' insert your fieldname here, generally "Body"

' Make your rich text changes here, for instance:
Call rti.AddNewLine(1, True)
Call rti.AppendText(Now & ": log entry.")
If session.NotesBuildVersion >= 190 Then
rti.Update ' ND6 only
Else
Call doc.ComputeWithForm(True, False) ' caution, as this may erase some field values if you have @Db functions in formulas.
End If

doc.SaveOptions = "0" ' make it possible to close the document without a "do you want to save" prompt. If this is a mail-in doc you may need to set MailOptions="0" also to avoid being prompted.
Call uidoc.Close
Set uidocNew = wksp.EditDocument(True, doc, , , , True)
Delete uidoc
uidocNew.Document.RemoveItem("SaveOptions")
If strFieldname <> "" Then uidocNew.GotoField(strFieldname) ' return focus to field that was current before.

Note: this will cause Queryclose, Queryopen, Postopen (and so on) form events to trigger. Also, uidoc.Refresh will execute computed field formulas and input validations, so you should write the validation formulas to not return @Failure unless @IsDocBeingSaved | @IsDocBeingSent is true.